mirror of
https://github.com/quantum5/qcal.git
synced 2025-07-27 03:34:11 -04:00
common: implement extended Haabʼ with year numbers
We define year 0 as the year with the Mayan creation, i.e. Long Count date 0.0.0.0.0, with years incrementing every 0 Pop.
This commit is contained in:
parent
7a3e62df17
commit
5e9e9e7fae
|
@ -108,6 +108,17 @@ export function jdnHaab(jdn: number): Haab {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export type HaabExt = Haab & {
|
||||||
|
year: number,
|
||||||
|
};
|
||||||
|
|
||||||
|
export function jdnHaabExt(jdn: number): HaabExt {
|
||||||
|
return {
|
||||||
|
...jdnHaab(jdn),
|
||||||
|
year: Math.floor((jdn - 583935) / 365),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
export type LordOfNight = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9;
|
export type LordOfNight = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9;
|
||||||
|
|
||||||
export function formatLordOfNight(lordOfNight: LordOfNight): string {
|
export function formatLordOfNight(lordOfNight: LordOfNight): string {
|
||||||
|
|
Loading…
Reference in a new issue