UNPKG

@burglekitt/gmt

Version:

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

14 lines (13 loc) 401 B
/** * Return the year for a given ISO 8601 date string. * * - Returns the year as a string (e.g., "2024"). * - Returns "" for invalid input. * * @param value ISO date string * @returns Year (YYYY) or "" on invalid input * * @example parseYearFromDate("2024-03-15") // "2024" * @example parseYearFromDate("invalid") // "" */ export declare function parseYearFromDate(value: string): string;