Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@preco21
Last active August 5, 2016 03:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save preco21/b8a015ffa682faa0914b7f0724bc01fc to your computer and use it in GitHub Desktop.
Save preco21/b8a015ffa682faa0914b7f0724bc01fc to your computer and use it in GitHub Desktop.
Get leap year days
function getYearDays(year) {
const isLeapYear = (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0;
return isLeapYear ? 366 : 365;
}
export {
getYearDays as default,
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment