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}