@northguild/gmt
Version:
Date and time library for JavaScript and TypeScript, built on TC39 Temporal: time zones, DST, business days, ISO 8601 strings in and out. Never throws.
16 lines • 684 B
TypeScript
/**
* Return the month-day (`--MM-DD`) of an ISO 8601 date string.
*
* - The year is dropped, so `2023-02-28` and `2024-02-28` give the same month-day.
* - Only the ISO calendar is read; a Hebrew or Islamic date gives `""`.
* - Returns "" for invalid input.
*
* @param value ISO date string
* @returns The canonical `--MM-DD` string, or "" on invalid input
*
* @example parseMonthDayFromDate("2024-12-25") // "--12-25"
* @example parseMonthDayFromDate("2024-02-29") // "--02-29"
* @example parseMonthDayFromDate("2024-02-30") // ""
* @example parseMonthDayFromDate("2024-12-25[u-ca=hebrew]") // ""
*/
export declare function parseMonthDayFromDate(value: string): string;