Skip to content

Instantly share code, notes, and snippets.

@MinweiShen
Created March 3, 2016 01:15
Show Gist options
  • Select an option

  • Save MinweiShen/6b1e5b49ff1f5a075648 to your computer and use it in GitHub Desktop.

Select an option

Save MinweiShen/6b1e5b49ff1f5a075648 to your computer and use it in GitHub Desktop.

Revisions

  1. MinweiShen created this gist Mar 3, 2016.
    3 changes: 3 additions & 0 deletions days_of_month.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,3 @@
    return month === 1 ?
    ((year % 4 ===0 && year%100!==0) or year %400===0) ? 28 : 29) : /* February */
    ((month % 2) ^ (month < 7) ? 31 : 30); /* Other months */