UNPKG

@burglekitt/gmt

Version:

Temporal-based date and time utilities with timezone support and polyfill integration

17 lines (16 loc) 594 B
/** * Return true if `value` is a valid ISO PlainDate string. * * - Uses regex to check format before parsing. * - Rejects leap seconds (e.g., "2024-12-31T23:59:60"). * - Rejects invalid dates (e.g., "2024-02-30"). * * @param value ISO PlainDate string * @returns boolean indicating validity * * @example isValidDate("2024-03-10") // true * @example isValidDate("2024-02-30") // false * @example isValidDate("invalid") // false * @example isValidDate("2024-12-31T23:59:60") // false (leap second - not a valid date) */ export declare function isValidDate(value: string): boolean;