the year 50 is the year 50, not 1950

new Date(50, 0, 1) is 1950: the Date constructor reads a year of 0..99
as 1900 + n, and the setter does not. This calendar answers from the
year 1, so pascha() for an early year had been quietly reporting a
twentieth-century date.
This commit is contained in:
funkpower
2026-09-18 14:56:57 -04:00
parent 899d9d9b00
commit f68f8a7c02
2 changed files with 16 additions and 1 deletions
+8
View File
@@ -129,6 +129,14 @@ check("pascha matches the published dates", () => {
assert.equal(iso(typikon.pascha(2027, "old")), "2027-05-02");
});
check("a two-digit year is that year, not 19xx", () => {
// The Date constructor reads 0..99 as 1900 + n, which would have made the
// Paschalion for the year 50 answer for 1950 without a word.
assert.equal(typikon.pascha(50, "old").getFullYear(), 50);
assert.equal(typikon.pascha(99, "old").getFullYear(), 99);
assert.equal(typikon.pascha(100, "old").getFullYear(), 100);
});
check("every listed jurisdiction reckons", () => {
const all = typikon.jurisdictions();
assert.ok(all.length > 20);