UNPKG

795 BJavaScriptView Raw
1export function easter(y, offset) {
2 if (offset === void 0) { offset = 0; }
3 var a = y % 19;
4 var b = Math.floor(y / 100);
5 var c = y % 100;
6 var d = Math.floor(b / 4);
7 var e = b % 4;
8 var f = Math.floor((b + 8) / 25);
9 var g = Math.floor((b - f + 1) / 3);
10 var h = Math.floor(19 * a + b - d - g + 15) % 30;
11 var i = Math.floor(c / 4);
12 var k = c % 4;
13 var l = Math.floor(32 + 2 * e + 2 * i - h - k) % 7;
14 var m = Math.floor((a + 11 * h + 22 * l) / 451);
15 var month = Math.floor((h + l - 7 * m + 114) / 31);
16 var day = ((h + l - 7 * m + 114) % 31) + 1;
17 var date = Date.UTC(y, month - 1, day + offset);
18 var yearStart = Date.UTC(y, 0, 1);
19 return [Math.ceil((date - yearStart) / (1000 * 60 * 60 * 24))];
20}
21//# sourceMappingURL=easter.js.map
\No newline at end of file