UNPKG

@burglekitt/gmt

Version:

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

18 lines (17 loc) 699 B
/** * Return the week of the year (1-53) for a given ISO 8601 zoned datetime string. * * - By default uses ISO weeks (Monday-based). * - Returns null for invalid input. * * @param value ISO zoned datetime string * @param optionsArg optional: weekStartsOn ("monday" | "sunday") for week calculations * @returns Week number (1-53) or null on invalid input * * @example parseWeekFromZoned("2024-01-01T14:30:45.123+00:00[UTC]") // 1 * @example parseWeekFromZoned("2024-01-08T14:30:45.123+00:00[UTC]") // 2 * @example parseWeekFromZoned("invalid") // null */ export declare function parseWeekFromZoned(value: string, optionsArg?: { weekStartsOn?: "monday" | "sunday"; }): number | null;