Hacker News new | ask | show | jobs
by _lce0 4215 days ago
how about this?

        leap = function(x) { 
          if ((x % 4) != 0) {
            return 0;
          }
          return Number(
            (x % 100) != 0 || (x % 400) == 0
          );
        }

        function(x) { return 28 + leap(x) + (...) };