From f755e38970148c9e5ca70e192e5cdd4422be356c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yi=C4=9Fit=20FINDIKLI?= Date: Wed, 1 Dec 2021 15:27:21 +0300 Subject: [PATCH] Fixed #10906 - Calendar | Year Picker and Month Picker empty when using Range and Multiple options --- src/app/components/calendar/calendar.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/app/components/calendar/calendar.ts b/src/app/components/calendar/calendar.ts index af52f686674..fe48665eb0b 100755 --- a/src/app/components/calendar/calendar.ts +++ b/src/app/components/calendar/calendar.ts @@ -1210,11 +1210,15 @@ export class Calendar implements OnInit,OnDestroy,ControlValueAccessor { } isMonthSelected(month) { - return this.isComparable() ? (this.value.getMonth() === month && this.value.getFullYear() === this.currentYear) : false; + let value = this.isRangeSelection() ? this.value[0] : this.value; + + return !this.isMultipleSelection() && this.isComparable() ? (value.getMonth() === month && value.getFullYear() === this.currentYear) : false; } isYearSelected(year) { - return this.isComparable() ? (this.value.getFullYear() === year) : false; + let value = this.isRangeSelection() ? this.value[0] : this.value; + + return !this.isMultipleSelection() && this.isComparable() ? (value.getFullYear() === year) : false; } isDateEquals(value, dateMeta) {