@burglekitt/gmt
Version:
Temporal-based date and time utilities with timezone support and polyfill integration
15 lines (14 loc) • 556 B
TypeScript
/**
* Return the current week of year for the specified IANA timeZone.
*
* - Uses Temporal.Now.zonedDateTimeISO to get the current time.
* - Uses Temporal.PlainDate.weekOfYear for ISO week number.
* - Validation is performed on the timezone.
*
* @param ianaTimezone IANA timeZone identifier
* @returns current week number (1-53) or null on invalid input
*
* @example getZonedWeekOfYear("America/New_York") // 9
* @example getZonedWeekOfYear("invalid") // null
*/
export declare function getZonedWeekOfYear(ianaTimezone: string): number | null;