From 88bf611c90b0f94db85947d7c054cafec62b9ecb Mon Sep 17 00:00:00 2001 From: Quantum Date: Thu, 19 Jun 2025 22:25:19 -0400 Subject: [PATCH] gcal: fix missing first week on negative JDN months --- gcal/src/Calendar.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcal/src/Calendar.tsx b/gcal/src/Calendar.tsx index 57f1577..b45dcf7 100644 --- a/gcal/src/Calendar.tsx +++ b/gcal/src/Calendar.tsx @@ -68,7 +68,7 @@ function Day({year, month, day, todayJDN}: DateProps & { todayJDN: number }): JS function Month({year, month, todayJDN}: MonthProps & { todayJDN: number }): JSX.Element { const decadeHeads = weekdayNames.map((name, i) => ); const firstJDN = gregorianJDN(year, month, 1); - const firstWeekday = (firstJDN + 1) % 7; + const firstWeekday = (firstJDN % 7 + 8) % 7; const daysTotal = gregorianMonthDays(year, month); return
{decadeHeads}