Skip to content

Commit

Permalink
Fix primefaces#4418: Calendar highlight selected months/years in mult…
Browse files Browse the repository at this point in the history
…iple
  • Loading branch information
melloware committed Sep 9, 2023
1 parent 4b46b75 commit c0bfd1a
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 c0bfd1a

Please sign in to comment.