kodie
8/1/2017 - 3:19 PM

orthodoxEaster.js

  var orthodoxEaster = function(y) {
    var d = (19 * (y % 19) + 15) % 30;
    var x = d + (2 * (y % 4) + 4 * (y % 7) - d + 34) % 7 + 114;
    var m = Math.floor(x / 31);
    d = x % 31 + 1;
    if (y > 1899 && y < 2100) {
      d += 13;
      if (m == 3 && d > 31) { d -= 31; m++; }
      if (m == 4 && d > 30) { d -= 30; m++; }
    }
    return moment([y, (m - 1), d]);
  };