mirror of
https://github.com/quantum5/qcal.git
synced 2025-07-27 03:34:11 -04:00
common: define type for Mayan Lords of the Night
This commit is contained in:
parent
fc6bc47f16
commit
a8d230f478
|
@ -1,4 +1,4 @@
|
|||
import {formatHaab, formatTzolkin, jdnHaab, jdnTzolkin, TzolkinName, tzolkinName} from './mayan';
|
||||
import {formatHaab, formatLordOfNight, formatTzolkin, jdnHaab, jdnTzolkin, TzolkinName, tzolkinName} from './mayan';
|
||||
|
||||
describe('tzolkinName', () => {
|
||||
it('should return correct name for IMIX', () => {
|
||||
|
@ -153,3 +153,41 @@ describe('jdnHaab', () => {
|
|||
expect(jdnHaab(-1)).toEqual({month: 4, day: 4});
|
||||
});
|
||||
});
|
||||
|
||||
describe('formatLordOfNight', () => {
|
||||
it('should format Lord of Night 1', () => {
|
||||
expect(formatLordOfNight(1)).toBe('G1');
|
||||
});
|
||||
|
||||
it('should format Lord of Night 2', () => {
|
||||
expect(formatLordOfNight(2)).toBe('G2');
|
||||
});
|
||||
|
||||
it('should format Lord of Night 3', () => {
|
||||
expect(formatLordOfNight(3)).toBe('G3');
|
||||
});
|
||||
|
||||
it('should format Lord of Night 4', () => {
|
||||
expect(formatLordOfNight(4)).toBe('G4');
|
||||
});
|
||||
|
||||
it('should format Lord of Night 5', () => {
|
||||
expect(formatLordOfNight(5)).toBe('G5');
|
||||
});
|
||||
|
||||
it('should format Lord of Night 6', () => {
|
||||
expect(formatLordOfNight(6)).toBe('G6');
|
||||
});
|
||||
|
||||
it('should format Lord of Night 7', () => {
|
||||
expect(formatLordOfNight(7)).toBe('G7');
|
||||
});
|
||||
|
||||
it('should format Lord of Night 8', () => {
|
||||
expect(formatLordOfNight(8)).toBe('G8');
|
||||
});
|
||||
|
||||
it('should format Lord of Night 9', () => {
|
||||
expect(formatLordOfNight(9)).toBe('G9');
|
||||
});
|
||||
});
|
||||
|
|
|
@ -107,3 +107,9 @@ export function jdnHaab(jdn: number): Haab {
|
|||
day: yearDay % 20 as HaabDay,
|
||||
};
|
||||
}
|
||||
|
||||
export type LordOfNight = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9;
|
||||
|
||||
export function formatLordOfNight(lordOfNight: LordOfNight): string {
|
||||
return `G${lordOfNight}`;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue