Skip to content

Function.weekOfYear

github-actions[bot] edited this page Aug 26, 2026 · 18 revisions

umt / weekOfYear

Function: weekOfYear()

weekOfYear(date): number

Defined in: Date/weekOfYear.ts:13

Returns the Sunday-start week number of the date's local year. Week 1 is the Sunday-start week that contains January 1.

Parameters

date

Date

Date to inspect

Returns

number

Week number starting at 1

Example

weekOfYear(new Date(2025, 0, 1)); // 1
weekOfYear(new Date(2025, 0, 5)); // 2

API

Classes

Interfaces

Type Aliases

Variables

Functions

Clone this wiki locally