Skip to content

Commit

Permalink
fix: primefaces#14087 || [Calendar] issue when clicking on "today" bu…
Browse files Browse the repository at this point in the history
…tton it doesn't navigate to the current date.
  • Loading branch information
ashikjs committed Nov 13, 2023
1 parent b280af2 commit 2483b51
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 @@ -3234,9 +3234,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 2483b51

Please sign in to comment.