Skip to content

Function: weekOfYear()

ts
function weekOfYear(date): number;

ISO week number (1–53) for a date in local time. 本地时间下的 ISO 周序号(1–53)。

Parameters

ParameterType
dateDate

Returns

number

Example

ts
weekOfYear(new Date(2026, 4, 8)) // => 19

Since

1.0.0

Released under the MIT License.