mirror of
https://github.com/quantum5/qcal.git
synced 2025-07-27 03:34:11 -04:00
Compare commits
No commits in common. "15129bdde0b640197b98bc6dbc0ab6faf4d404e9" and "af113d9fe685d994e58459f156d2613e0b5d8fc0" have entirely different histories.
15129bdde0
...
af113d9fe6
|
@ -1,7 +1,7 @@
|
|||
import {
|
||||
formatHaab,
|
||||
formatLordOfNight,
|
||||
formatTzolkin, HaabMonth, haabMonthDays,
|
||||
formatTzolkin,
|
||||
jdnHaab, jdnHaabExt,
|
||||
jdnLordOfNight,
|
||||
jdnTzolkin,
|
||||
|
@ -163,18 +163,6 @@ describe('jdnHaab', () => {
|
|||
});
|
||||
});
|
||||
|
||||
describe('haabMonthDays', () => {
|
||||
it('returns 20 days for months 1-18', () => {
|
||||
for (let month = 1; month <= 18; month++) {
|
||||
expect(haabMonthDays(month as HaabMonth)).toBe(20);
|
||||
}
|
||||
});
|
||||
|
||||
it('returns 5 days for month 19 (Wayeb)', () => {
|
||||
expect(haabMonthDays(19)).toBe(5);
|
||||
});
|
||||
});
|
||||
|
||||
describe('jdnHaabExt', () => {
|
||||
it('handles creation correctly', () => {
|
||||
expect(jdnHaabExt(583934)).toEqual({year: -1, month: 19, day: 4}); // end of the year before creation
|
||||
|
|
|
@ -108,14 +108,8 @@ export function jdnHaab(jdn: number): Haab {
|
|||
};
|
||||
}
|
||||
|
||||
export function haabMonthDays(month: HaabMonth): number {
|
||||
return month === 19 ? 5 : 20;
|
||||
}
|
||||
|
||||
export type HaabYear = number;
|
||||
|
||||
export type HaabExt = Haab & {
|
||||
year: HaabYear,
|
||||
year: number,
|
||||
};
|
||||
|
||||
export function jdnHaabExt(jdn: number): HaabExt {
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import React from 'react';
|
||||
import {Calendar} from './Calendar';
|
||||
import {FrenchMonth, frEndJD, frStartJD, frSupportedYear, jdnFrench} from '@common/french';
|
||||
import {JulianMonth} from '@common/gregorian';
|
||||
import {TimeOfDay} from './TimeOfDay';
|
||||
import {GregorianJumper} from '@common/dateJump';
|
||||
import MonthBasedApp from '@common/ui/MonthBasedApp';
|
||||
|
@ -10,7 +11,7 @@ export default class App extends MonthBasedApp<number, FrenchMonth> {
|
|||
override parseYearMonth(year: string, month: string) {
|
||||
if (!frSupportedYear(+year) || +month < 1 || +month > 13)
|
||||
return null;
|
||||
return {year: +year, month: +month as FrenchMonth};
|
||||
return {year: +year, month: +month as JulianMonth};
|
||||
}
|
||||
|
||||
override defaultSelector(todayJDN: number) {
|
||||
|
|
Loading…
Reference in a new issue