Skip to content

Commit

Permalink
Fixed #10931 Calendar | Year Picker and Month Picker empty when value…
Browse files Browse the repository at this point in the history
… empty and using Range or Multiple Selection
  • Loading branch information
yigitfindikli committed Dec 7, 2021
1 parent 10e9021 commit 302cb38
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions src/app/components/calendar/calendar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1212,15 +1212,23 @@ export class Calendar implements OnInit,OnDestroy,ControlValueAccessor {
}

isMonthSelected(month) {
let value = this.isRangeSelection() ? this.value[0] : this.value;
if (this.isComparable()) {
let value = this.isRangeSelection() ? this.value[0] : this.value;

return !this.isMultipleSelection() && this.isComparable() ? (value.getMonth() === month && value.getFullYear() === this.currentYear) : false;
return !this.isMultipleSelection() ? (value.getMonth() === month && value.getFullYear() === this.currentYear) : false;
}

return false;
}

isYearSelected(year) {
let value = this.isRangeSelection() ? this.value[0] : this.value;
if (this.isComparable()) {
let value = this.isRangeSelection() ? this.value[0] : this.value;

return !this.isMultipleSelection() && this.isComparable() ? (value.getFullYear() === year) : false;
return !this.isMultipleSelection() ? (value.getFullYear() === year) : false;
}

return false;
}

isDateEquals(value, dateMeta) {
Expand Down

0 comments on commit 302cb38

Please sign in to comment.