Merge pull request #5988 from KumJungMin/fix/isssue-v3-#5883_
fix(Calendar): highlight range of year in YearModepull/6506/head
commit
fbd068d9f9
|
@ -717,17 +717,18 @@ export default {
|
||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
isYearSelected(year) {
|
isYearSelected(year) {
|
||||||
if (this.isComparable()) {
|
if (!this.isComparable()) return false;
|
||||||
let value = this.isRangeSelection() ? this.modelValue[0] : this.modelValue;
|
|
||||||
|
|
||||||
if (this.isMultipleSelection()) {
|
if (this.isMultipleSelection()) {
|
||||||
return value.some((currentValue) => currentValue.getFullYear() === year);
|
return this.modelValue.some((currentValue) => currentValue.getFullYear() === year);
|
||||||
} else {
|
} else if (this.isRangeSelection()) {
|
||||||
return value.getFullYear() === year;
|
const start = this.modelValue[0] ? this.modelValue[0].getFullYear() : null;
|
||||||
}
|
const end = this.modelValue[1] ? this.modelValue[1].getFullYear() : null;
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
return start === year || end === year || (start < year && end > year);
|
||||||
|
} else {
|
||||||
|
return this.modelValue.getFullYear() === year;
|
||||||
|
}
|
||||||
},
|
},
|
||||||
isDateEquals(value, dateMeta) {
|
isDateEquals(value, dateMeta) {
|
||||||
if (value) return value.getDate() === dateMeta.day && value.getMonth() === dateMeta.month && value.getFullYear() === dateMeta.year;
|
if (value) return value.getDate() === dateMeta.day && value.getMonth() === dateMeta.month && value.getFullYear() === dateMeta.year;
|
||||||
|
|
Loading…
Reference in New Issue