@burglekitt/gmt
Version:
Temporal-based date and time utilities with timezone support and polyfill integration
15 lines (14 loc) • 515 B
TypeScript
/**
* Return true when the given PlainDate falls in a leap year.
*
* - A leap year is divisible by 4, except for century years which must be divisible by 400.
* - Returns false for invalid input strings.
*
* @param value ISO PlainDate string
* @returns boolean indicating whether the date is in a leap year
*
* @example isLeapYear("2024-03-15") // true
* @example isLeapYear("2023-03-15") // false
* @example isLeapYear("invalid") // false
*/
export declare function isLeapYear(value: string): boolean;