From c5842a2153db8f4dba0825b848c96676f2d2597e Mon Sep 17 00:00:00 2001 From: Melloware Date: Thu, 5 Oct 2023 09:05:24 -0400 Subject: [PATCH] Fix #4418: Calendar highlight selected months/years in multiple (#4419) --- 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 aeaf70ab6c..d8d0668ad4 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;