From 2e007500c97e3f7be18627363c7fa7b926fd66ad Mon Sep 17 00:00:00 2001 From: Quantum Date: Sun, 13 Jul 2025 15:44:15 -0400 Subject: [PATCH] mcal: display Tzolkin and Haab month names --- mcal/src/Calendar.tsx | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/mcal/src/Calendar.tsx b/mcal/src/Calendar.tsx index 00259b6..f8ab84c 100644 --- a/mcal/src/Calendar.tsx +++ b/mcal/src/Calendar.tsx @@ -4,7 +4,7 @@ import {jdnDate} from '@common/gregorian'; import {jdnLongCount} from '@common/longCount'; import {MonthBasedCalendar} from '@common/ui/MonthBasedCalendar'; import { - formatLordOfNight, + formatLordOfNight, formatTzolkin, HaabDay, haabExtJDN, HaabMonth, @@ -12,7 +12,7 @@ import { haabNames, HaabYear, jdnHaabExt, - jdnLordOfNight, + jdnLordOfNight, jdnTzolkin, } from '@common/mayan'; type MonthProps = { @@ -24,21 +24,22 @@ type DateProps = MonthProps & { day: HaabDay; }; -function NormalDay({year, month, day, todayJDN}: DateProps & { todayJDN: number }): JSX.Element { +function Day({year, month, day, todayJDN}: DateProps & { todayJDN: number }): JSX.Element { const jdn = haabExtJDN({year, month, day}); return
-
{day}
-
{jdnLongCount(jdn)?.join('.')}
+
{day} {haabNames[month]}
+
{formatTzolkin(jdnTzolkin(jdn))}
+
{jdnLongCount(jdn)?.join('.')}
{formatLordOfNight(jdnLordOfNight(jdn))}
-
{jdnDate(jdn).toDateString()}
+
{jdnDate(jdn).toDateString()}
; } function Month({year, month, todayJDN}: MonthProps & { todayJDN: number }): JSX.Element { return
{ - Array.from(Array(haabMonthDays(month)).keys()).map(i =>
- + Array.from(Array(haabMonthDays(month)).keys()).map(i =>
+
) }
;