Skip to content

getWeekOfYear Type documentation

(date: Date, weekStart: WeekStart) => number
Function
Returns the ISO-8601 week number for the user's week containing the specified date. ISO-8601 weeks always start on Monday. When the user's week starts on Sunday or Saturday, the date is adjusted to find the corresponding ISO week (based on the Thursday rule). The first week of a year is the week that contains the first Thursday of the year (='First 4-day week'). The highest week number in a year is either 52 or 53.
Returns The number of the Week
Parameters
The JavaScript date object.
date: Date
Name of the first day of the week
weekStart: WeekStart

Types Documentation

("monday" | "saturday" | "sunday" | undefined)

Except where otherwise noted, content on this site is licensed under MIT License.