Skip to content

Instantly share code, notes, and snippets.

@tyfkda
Last active August 29, 2015 14:15
Show Gist options
  • Save tyfkda/6b3f6401ab2c39d80475 to your computer and use it in GitHub Desktop.
Save tyfkda/6b3f6401ab2c39d80475 to your computer and use it in GitHub Desktop.
JavaScriptでうるう年判定 ref: http://qiita.com/tyfkda/items/bd2e2e93d5875547f8cf
// 与えられた西暦がうるう年かどうかを返す
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