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
>(
input: GenericInput,
timezone?: Timezone
): numberParameters
input: TargetTheDate.timezone: (Optional) IANA timezone.
Return value
An integer between 1 and 53 corresponding to the ISO week.
