fix: 🐛 fix prev/next month date not link to right note

This commit is contained in:
Jin 2025-03-31 19:40:10 +02:00
parent 45633ad418
commit 3b67364916

View File

@ -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;
});
}