We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2aa0f73 commit d2f8612Copy full SHA for d2f8612
_experimental/datetime/easter_date.js
@@ -0,0 +1,15 @@
1
+function easter_date(year) {
2
+ // Based on algorithm from polish wikipedia (http://pl.wikipedia.org/wiki/Wielkanoc)
3
+
4
+ year = isNaN(year) ? new Date().getFullYear() : +year;
5
6
+ var a = year % 19,
7
+ b = year / 100 | 0,
8
+ c = year % 100,
9
+ h = (19 * a + b - (b / 4 | 0) - ((b - ((b + 8) / 25 | 0) + 1) / 3 | 0) + 15) % 30,
10
+ l = (32 + 2 * (b % 4) + 2 * (c / 4 | 0) - h - c % 4) % 7,
11
+ m = Math.floor((a + 11 * h + 22 * l) / 451);
12
13
+ return new Date(year, Math.floor((h + l - 7 * m + 114) / 31) - 1, (h + l - 7 * m + 114) % 31 + 1) / 1e3 | 0;
14
15
+}
0 commit comments