getZonedWeekOfYear
Signature
Section titled “Signature”getZonedWeekOfYear(ianaTimezone: string): numberimport { getZonedWeekOfYear } from "@northguild/gmt/zoned/get";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.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
ianaTimezone |
string |
IANA timeZone identifier |
Returns
Section titled “Returns”current week number (1-53) or null on invalid input
Examples
Section titled “Examples”getZonedWeekOfYear("America/New_York") // 9getZonedWeekOfYear("invalid") // null