Skip to content

Commit

Permalink
Fixed #10906 - Calendar | Year Picker and Month Picker empty when usi…
Browse files Browse the repository at this point in the history
…ng Range and Multiple options
  • Loading branch information
yigitfindikli committed Dec 1, 2021
1 parent 56d104a commit f755e38
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/app/components/calendar/calendar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit f755e38

Please sign in to comment.