diff --git a/lib/easter.ts b/lib/easter.ts index 4a0105d..ed40f0f 100644 --- a/lib/easter.ts +++ b/lib/easter.ts @@ -37,13 +37,13 @@ export function getEasterSunday(year: number): DateTime { const e = b % 4; // eslint-disable-line unicorn/prevent-abbreviations const f = Math.floor((b + 8) / 25); const g = Math.floor((b - f + 1) / 3); - const h = (19 * a + b - d - g + 15) % 30; + const h = ((19 * a) + b - d - g + 15) % 30; const i = Math.floor(c / 4); const k = c % 4; - const l = (32 + 2 * e + 2 * i - h - k) % 7; - const m = Math.floor((a + 11 * h + 22 * l) / 451); - const month = Math.floor((h + l - 7 * m + 114) / 31); - const day = ((h + l - 7 * m + 114) % 31) + 1; + const l = (32 + (2 * e) + (2 * i) - h - k) % 7; + const m = Math.floor((a + (11 * h) + (22 * l)) / 451); + const month = Math.floor((h + l - (7 * m) + 114) / 31); + const day = ((h + l - (7 * m) + 114) % 31) + 1; return DateTime.fromObject({year, month, day}); } diff --git a/test/easter.ts b/test/easter.ts index 543cd4c..3d745d9 100644 --- a/test/easter.ts +++ b/test/easter.ts @@ -83,4 +83,4 @@ test('Get Holy Week days names in 2025', t => { // After Holy Week t.falsy(getEasterDayName(DateTime.fromISO('2025-04-22'))); -}); \ No newline at end of file +});