Merge pull request #5988 from KumJungMin/fix/isssue-v3-#5883_

fix(Calendar): highlight range of year in YearMode
pull/6506/head
Tuğçe Küçükoğlu 2024-09-25 15:03:01 +03:00 committed by GitHub
commit fbd068d9f9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 10 additions and 9 deletions

View File

@ -717,17 +717,18 @@ export default {
return false;
},
isYearSelected(year) {
if (this.isComparable()) {
let value = this.isRangeSelection() ? this.modelValue[0] : this.modelValue;
if (!this.isComparable()) return false;
if (this.isMultipleSelection()) {
return value.some((currentValue) => currentValue.getFullYear() === year);
} else {
return value.getFullYear() === year;
}
if (this.isMultipleSelection()) {
return this.modelValue.some((currentValue) => currentValue.getFullYear() === year);
} else if (this.isRangeSelection()) {
const start = this.modelValue[0] ? this.modelValue[0].getFullYear() : null;
const end = this.modelValue[1] ? this.modelValue[1].getFullYear() : null;
return start === year || end === year || (start < year && end > year);
} else {
return this.modelValue.getFullYear() === year;
}
return false;
},
isDateEquals(value, dateMeta) {
if (value) return value.getDate() === dateMeta.day && value.getMonth() === dateMeta.month && value.getFullYear() === dateMeta.year;