From 4381415fa09f33d2f06569ef9919a2cefd527e72 Mon Sep 17 00:00:00 2001 From: Quantum Date: Wed, 2 Jul 2025 01:19:37 -0400 Subject: [PATCH] gcal: use jdnWeekDay instead of ad hoc logic --- gcal/src/Calendar.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gcal/src/Calendar.tsx b/gcal/src/Calendar.tsx index 7938a89..0640db5 100644 --- a/gcal/src/Calendar.tsx +++ b/gcal/src/Calendar.tsx @@ -8,6 +8,7 @@ import { JulianDay, JulianMonth, monthName, + jdnWeekDay, weekdayNames, } from '@common/gregorian'; import {formatHaab, formatTzolkin, jdnHaab, jdnTzolkin} from '@common/mayan'; @@ -64,7 +65,7 @@ function Day({year, month, day, todayJDN}: DateProps & { todayJDN: number }): JS const jdn = gregorianJDN(year, month, day); return
{day}
-
{weekdayNames[(jdn + 1) % 7]}
+
{weekdayNames[jdnWeekDay(jdn)]}
; } @@ -72,7 +73,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 % 7 + 8) % 7; + const firstWeekday = jdnWeekDay(firstJDN); const daysTotal = gregorianMonthDays(year, month); return
{decadeHeads}