Intl.Locale.prototype.getWeekInfo()
Baseline 2026>
Newly available
Since July 2026, this feature works across the latest devices and browser versions. This feature might not work in older devices or browsers.
The getWeekInfo() method of Intl.Locale instances returns week information about the locale, such as the first day of the week and the weekend days.
Note:
In some versions of some browsers, this method was implemented as an accessor property called weekInfo. However, because it returns a new object on each access, it is now implemented as a method to prevent the situation of locale.weekInfo === locale.weekInfo returning false. Check the browser compatibility table for details.
Syntax
getWeekInfo()
Parameters
None.
Return value
An object representing week information associated with the Locale data specified in UTS 35's Week Elements, according to its region preferences. It has the following properties:
firstDay-
An integer between 1 (Monday) and 7 (Sunday) indicating the first day of the week for the locale. Commonly 1, 5, 6, or 7. If the
Localealready has afirstDayOfWeekvalue set, thenfirstDayis the same day represented as a number. weekend-
An array of integers between 1 and 7 indicating the weekend days for the locale. This is usually continuous because UTS 35 stores
weekendStartandweekendEndinstead. minimalDays-
An integer between 1 and 7 (commonly 1 and 4) indicating the minimal days required in the first week of a month or year, for week-of-year or week-of-month calculations (e.g., The 20th week of the year). For example, in the ISO 8601 calendar, the first week of a year must have at least 4 days in this year, so if January 1 is a Friday, Saturday, or Sunday, it will be numbered as part of the last week of the previous year.
Note: This property has been removed from the spec and is being removed from browsers because users generally expect ISO rules to be applied regardless of the locale.
Examples
>Obtaining week information
The getWeekInfo() method returns the week information for a given Locale. For examples of explicitly setting a firstDayOfWeek, see firstDayOfWeek examples.
const he = new Intl.Locale("he"); // Hebrew (Israel)
console.log(he.getWeekInfo()); // { firstDay: 7, weekend: [5, 6] }
const af = new Intl.Locale("af"); // Afrikaans (South Africa)
console.log(af.getWeekInfo()); // { firstDay: 7, weekend: [6, 7] }
const enGB = new Intl.Locale("en-GB"); // English (United Kingdom)
console.log(enGB.getWeekInfo()); // { firstDay: 1, weekend: [6, 7] }
const arAF = new Intl.Locale("ar-AF"); // Arabic (Afghanistan)
console.log(arAF.getWeekInfo()); // { firstDay: 6, weekend: [4, 5] }
const dvMV = new Intl.Locale("dv-MV"); // Divehi (Maldives)
console.log(dvMV.getWeekInfo()); // { firstDay: 5, weekend: [6, 7] }
Region overrides
The rg and sd extension subtags change the region preferences, which can result in different week information being returned while the base name stays the same.
const enUS = new Intl.Locale("en-US");
console.log(enUS.getWeekInfo()); // { firstDay: 7, weekend: [6, 7] }
const enUSInUK = new Intl.Locale("en-US-u-rg-gbzzzz");
console.log(enUSInUK.getWeekInfo()); // { firstDay: 1, weekend: [6, 7] }
const enScot = new Intl.Locale("en-u-sd-gbsct");
console.log(enScot.getWeekInfo()); // { firstDay: 1, weekend: [6, 7] }
Specifications
| Specification |
|---|
| Intl Locale Info Proposal> # sec-Intl.Locale.prototype.getWeekInfo> |