diff --git a/src/public/app/widgets/buttons/calendar.ts b/src/public/app/widgets/buttons/calendar.ts index 08ab2186b..b5a06cce9 100644 --- a/src/public/app/widgets/buttons/calendar.ts +++ b/src/public/app/widgets/buttons/calendar.ts @@ -346,9 +346,12 @@ export default class CalendarWidget extends RightDropdownButtonWidget { this.$month.append($weekNumber); dates.forEach(date => { + const tempDate = this.date; + this.date = date; const $day = this.createDay(dateNotesForPrevMonth, date.getDate(), date.getDay()); $day.addClass('calendar-date-prev-month'); this.$month.append($day); + this.date = tempDate; }); } @@ -383,9 +386,12 @@ export default class CalendarWidget extends RightDropdownButtonWidget { const dateNotesForNextMonth: DateNotesForMonth = await server.get(`special-notes/notes-for-month/${nextMonthStr}`); dates.forEach(date => { + const tempDate = this.date; + this.date = date; const $day = this.createDay(dateNotesForNextMonth, date.getDate(), date.getDay()); $day.addClass('calendar-date-next-month'); this.$month.append($day); + this.date = tempDate; }); }