News for hackers. Stuff that matters.
Re:Doomsday rule: calculate the day for any date by elwell on Sunday August 10, 2014 @04:03PM (#8160572)

  calculateDay = (year, month, day) ->
    y = (year - 2000) % 28
    m = [6,2,2,5,0,3,5,1,4,6,2,4][month]
    m-- if month < 2 and y % 4 is 0
    y += (y / 4) | 0
    ['Sun','Mon','Tue','Wed','Thu','Fri','Sat'][(y + m + day) % 7]

There are no comments on this comment yet.