Last active
August 29, 2015 14:15
-
-
Save tyfkda/6b3f6401ab2c39d80475 to your computer and use it in GitHub Desktop.
JavaScriptでうるう年判定 ref: http://qiita.com/tyfkda/items/bd2e2e93d5875547f8cf
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 与えられた西暦がうるう年かどうかを返す | |
| function isLeap(year) { | |
| // うるう年の場合、"2月29日"は2月のはず | |
| return new Date(year, 2 - 1, 29).getMonth() == 2 - 1; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment