Skip to content

Commit

Permalink
Fix #4418: Calendar highlight selected months/years in multiple (#4419)
Browse files Browse the repository at this point in the history
  • Loading branch information
melloware authored Oct 5, 2023
1 parent 7f429b7 commit c5842a2
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions components/lib/calendar/Calendar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down

0 comments on commit c5842a2

Please sign in to comment.