getWeekOfYear
The getWeekOfYear() function calculates the ISO 8601 week number (1–53) for a TheDate, with an optional timezone.
Interactive example
Syntax
typescript
function getWeekOfYear<
GenericInput extends TheDate | SerializedTheDate
>(
input: GenericInput,
timezone: Timezone = "UTC"
): numberParameters
input:TheDateorSerializedTheDate.timezone: IANA timezone. Default:"UTC".
Return value
An integer between 1 and 53 corresponding to the ISO week.
