Fix org calendar every page starting Monday

This commit is contained in:
Kalle 2024-07-28 20:26:33 +03:00
parent 413d1394a2
commit 423cd86d78

View File

@ -142,7 +142,7 @@ export function dateToYYYYMMDD(date: Date) {
// same as datesOfMonth but contains null at the start to start with monday
export function nullPaddedDatesOfMonth({ month, year }: MonthYear) {
const dates = datesOfMonth({ month, year });
const firstDay = dates[0].getUTCDate();
const firstDay = dates[0].getUTCDay();
const nulls = Array.from(
{ length: firstDay === 0 ? 6 : firstDay - 1 },
() => null,