Skip to content

Instantly share code, notes, and snippets.

@xd547
Created February 26, 2014 10:28
Show Gist options
  • Select an option

  • Save xd547/9227241 to your computer and use it in GitHub Desktop.

Select an option

Save xd547/9227241 to your computer and use it in GitHub Desktop.
function isLeapYear(year) {
var result = false;
var yearVal = parseInt(year);
if (yearVal % 100 == 0) {
if (yearVal % 400 == 0) {
result = true;
}
} else {
if (yearVal % 4 == 0) {
result = true;
}
}
return result;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment