From dc783fced38fc4fe785809f9851b13c340491689 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yi=C4=9Fit=20FINDIKLI?= Date: Tue, 7 Dec 2021 10:39:36 +0300 Subject: [PATCH] Fixed #1848 - Calendar | Year Picker and Month Picker empty when using Range and Multiple options --- src/components/calendar/Calendar.vue | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/components/calendar/Calendar.vue b/src/components/calendar/Calendar.vue index 65dce9e51..7e60e58ce 100755 --- a/src/components/calendar/Calendar.vue +++ b/src/components/calendar/Calendar.vue @@ -443,10 +443,22 @@ export default { return false; }, isMonthSelected(month) { - return this.isComparable() ? (this.modelValue.getMonth() === month && this.modelValue.getFullYear() === this.currentYear) : false; + if (this.isComparable()) { + let value = this.isRangeSelection() ? this.modelValue[0] : this.modelValue; + + return !this.isMultipleSelection() ? (value.getMonth() === month && value.getFullYear() === this.currentYear) : false; + } + + return false; }, isYearSelected(year) { - return this.isComparable() ? (this.modelValue.getFullYear() === year) : false; + if (this.isComparable()) { + let value = this.isRangeSelection() ? this.modelValue[0] : this.modelValue; + + return !this.isMultipleSelection() && this.isComparable() ? (value.getFullYear() === year) : false; + } + + return false; }, isDateEquals(value, dateMeta) { if (value)