From c0bfd1ab990f24673923079c8c33f616fe2ce34a Mon Sep 17 00:00:00 2001 From: melloware Date: Sat, 9 Sep 2023 07:58:00 -0400 Subject: [PATCH] Fix #4418: Calendar highlight selected months/years in multiple --- components/lib/calendar/Calendar.vue | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/components/lib/calendar/Calendar.vue b/components/lib/calendar/Calendar.vue index 7f73dfd0b1..7468cbbf14 100755 --- a/components/lib/calendar/Calendar.vue +++ b/components/lib/calendar/Calendar.vue @@ -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;