Fix #4418: Calendar highlight selected months/years in multiple (#4419)

pull/4570/head
Melloware 2023-10-05 09:05:24 -04:00 committed by GitHub
parent 7f429b7b74
commit c5842a2153
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 2 deletions

View File

@ -674,7 +674,11 @@ export default {
if (this.isComparable()) {
let value = this.isRangeSelection() ? this.modelValue[0] : this.modelValue;
return !this.isMultipleSelection() ? value.getMonth() === month && value.getFullYear() === this.currentYear : false;
if (this.isMultipleSelection()) {
return value.some((currentValue) => currentValue.getMonth() === month && currentValue.getFullYear() === currentYear);
} else {
return value.getMonth() === month && value.getFullYear() === currentYear;
}
}
return false;
@ -683,7 +687,11 @@ export default {
if (this.isComparable()) {
let value = this.isRangeSelection() ? this.modelValue[0] : this.modelValue;
return !this.isMultipleSelection() && this.isComparable() ? value.getFullYear() === year : false;
if (this.isMultipleSelection()) {
return value.some((currentValue) => currentValue.getFullYear() === year);
} else {
return value.getFullYear() === year;
}
}
return false;