Skip to content

weekOfYearForDate

  • The core functions, which every industry uses.
weekOfYearForDate(value: string): number | null

Return the ISO week number for a given ISO 8601 date string.

  • Uses Temporal.PlainDate.weekOfYear (Monday-based ISO weeks).
  • Returns null for invalid input.
ParameterTypeDescription
valuestringISO 8601 date string

Week number (1-53) or null on invalid input

import { weekOfYearForDate } from "@northguild/gmt/plain/calculate";
weekOfYearForDate("2024-01-01") // 1
output 

plain/calculate/weekOfYearForDate.ts

Accessibility
© 2026 NorthGuild · Licences

Code examples: MIT-0. Packages: MIT. Third-party data and components: their own licences, credited where they appear. Everything else: © 2026 NorthGuild, all rights reserved.