getWeekOfMonth
Signature
Section titled “Signature”getWeekOfMonth(value: string, locale: string | string[]): number | nullReturn 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
valueorlocaleis invalid.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
value | string | ISO PlainDate string |
locale | string | 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 |
Returns
Section titled “Returns”1-based week-of-month row, or null on invalid input
Examples
Section titled “Examples”import { getWeekOfMonth } from "@northguild/gmt/plain/calculate";
getWeekOfMonth("2024-02-01", "ja-JP") // 1Source
Section titled “Source”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.