Skip to content

Instantly share code, notes, and snippets.

@MinweiShen
Created March 3, 2016 01:15
Show Gist options
  • Save MinweiShen/6b1e5b49ff1f5a075648 to your computer and use it in GitHub Desktop.
Save MinweiShen/6b1e5b49ff1f5a075648 to your computer and use it in GitHub Desktop.
return month === 1 ?
((year % 4 ===0 && year%100!==0) or year %400===0) ? 28 : 29) : /* February */
((month % 2) ^ (month < 7) ? 31 : 30); /* Other months */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment