add workaround for issue with sorting days into yearmonths/weeks

This commit is contained in:
2024-07-14 03:33:07 +02:00
parent 246572d7d0
commit 8d757c4652

View File

@ -196,6 +196,15 @@ export function organizeEventsInCalendar(
const yearMonth = formatDate(start, "yyyy-MM"); const yearMonth = formatDate(start, "yyyy-MM");
const week = formatDate(start, "w"); const week = formatDate(start, "w");
const day = formatDate(start, "yyyy-MM-dd"); const day = formatDate(start, "yyyy-MM-dd");
if (!calendar[yearMonth]) {
calendar[yearMonth] = {};
}
if (!calendar[yearMonth][week]) {
calendar[yearMonth][week] = {};
}
if (!calendar[yearMonth][week][day]) {
calendar[yearMonth][week][day] = [];
}
calendar[yearMonth][week][day].push(event); calendar[yearMonth][week][day].push(event);
}); });