From fb576a4a5ed2b166fe3a600c94c1a4eaa55caac2 Mon Sep 17 00:00:00 2001 From: Quantum Date: Tue, 8 Jul 2025 22:29:05 -0400 Subject: [PATCH] common: implement jdnLordOfNight --- common/src/mayan.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/common/src/mayan.ts b/common/src/mayan.ts index e9a5107..5186c7d 100644 --- a/common/src/mayan.ts +++ b/common/src/mayan.ts @@ -113,3 +113,7 @@ export type LordOfNight = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9; export function formatLordOfNight(lordOfNight: LordOfNight): string { return `G${lordOfNight}`; } + +export function jdnLordOfNight(jdn: number): LordOfNight { + return (jdn % 9 + 15) % 9 + 1 as LordOfNight; +}