Skip to content

getWeekOfMonth

  • The core functions, which every industry uses.
getWeekOfMonth(value: string, locale: string | string[]): number | null

Return the 1-based row value falls on within its month’s calendar grid, using locale’s first day of week.

  • Week 1 is the row containing the 1st of the month: UTS #35’s week of month (W, Part 4 Dates § Week Data) with the locale’s first day of week and minimal days fixed at 1. The locale’s own minDays (4 in much of Europe) is not applied, so a short leading week still counts: a month grid draws every day of the month.
  • Distinct from ISO weekOfYear: this counts rows within a single month’s grid, reset every month, rather than weeks since Jan 1.
  • Resolves the locale’s first day of week via Intl.Locale.prototype.weekInfo.
  • Returns null if value or locale is invalid.
ParameterTypeDescription
valuestringISO PlainDate string
localestring | string[]BCP 47 locale tag (e.g. “fr-FR”, “ja-JP”, “en-US”), or a preference list of tags (ECMA-402; the first with locale data is read). Required: omitted, or an empty list (which ECMA-402 would resolve to the host default), returns null

1-based week-of-month row, or null on invalid input

import { getWeekOfMonth } from "@northguild/gmt/plain/calculate";
getWeekOfMonth("2024-02-01", "ja-JP") // 1
output 

plain/calculate/getWeekOfMonth.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.