From eb4a7253f1d777046377ff2056c0a137f3dba498 Mon Sep 17 00:00:00 2001 From: Quantum Date: Fri, 20 Jun 2025 19:43:06 -0400 Subject: [PATCH] jcal: fix missing first week on negative JDN months --- jcal/src/Calendar.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jcal/src/Calendar.tsx b/jcal/src/Calendar.tsx index 0a8408b..9baf68b 100644 --- a/jcal/src/Calendar.tsx +++ b/jcal/src/Calendar.tsx @@ -54,7 +54,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 = julianJDN(year, month, 1); - const firstWeekday = (firstJDN + 1) % 7; + const firstWeekday = (firstJDN % 8 + 8) % 7; const daysTotal = julianMonthDays(year, month); return
{decadeHeads}