isLeapYear
Checks if the year in the date string or year (from 0 - 9999) is a leap year.
isLeapYear()
Checks if the year in the date string or year (from 0 - 9999) is a leap year.
Info
-
A year is a leap year if it is divisible by 4.
-
However, years divisible by 100 are not leap years unless they are also divisible by 400.
-
For example:
2000,2400→ leap years ✅1900,2100→ not leap years ❌s
Signature
static isLeapYear(date: ChronosInput): booleanParameters
date: Date to check
Return Type
boolean - Whether year is leap
Example
playground.ts
Last updated: Thu, May 21, 2026 07:12:18AM (UTC)
