Skip to content

Commit

Permalink
Merge pull request #14098 from ashikjs/issues-14087/calender-today-da…
Browse files Browse the repository at this point in the history
…te-click-not-reset-view

fix: #14087 || [Calendar] issue when clicking on "today" button it do…
  • Loading branch information
cetincakiroglu committed Nov 22, 2023
2 parents 2ed4010 + 2483b51 commit a539ed5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/app/components/calendar/calendar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3329,9 +3329,10 @@ export class Calendar implements OnInit, OnDestroy, ControlValueAccessor {
}

onTodayButtonClick(event: any) {
let date: Date = new Date();
let dateMeta = { day: date.getDate(), month: date.getMonth(), year: date.getFullYear(), otherMonth: date.getMonth() !== this.currentMonth || date.getFullYear() !== this.currentYear, today: true, selectable: true };
const date: Date = new Date();
const dateMeta = { day: date.getDate(), month: date.getMonth(), year: date.getFullYear(), otherMonth: date.getMonth() !== this.currentMonth || date.getFullYear() !== this.currentYear, today: true, selectable: true };

this.createMonths(date.getMonth(), date.getFullYear());
this.onDateSelect(event, dateMeta);
this.onTodayClick.emit(event);
}
Expand Down

0 comments on commit a539ed5

Please sign in to comment.