Intl.Locale.prototype.getWeekInfo()

Limited availability

This feature is not Baseline because it does not work in some of the most widely-used browsers.

The getWeekInfo() method of Intl.Locale instances returns a weekInfo object with the properties firstDay, weekend and minimalDays for this locale.

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

js
getWeekInfo()

Parameters

None.

Return value

An object representing week information associated with the Locale data specified in UTS 35's Week Elements. 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.

weekend

An array of integers between 1 and 7 indicating the weekend days for the locale. This is usually continuous because UTS 35 stores weekendStart and weekendEnd instead.

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.

Examples

Obtaining the Week Information

Return the week information for a given Locale.

js
const he = new Intl.Locale("he"); // Hebrew (Israel)
console.log(he.getWeekInfo()); // { firstDay: 7, weekend: [5, 6], minimalDays: 1 }

const af = new Intl.Locale("af"); // Afrikaans (South Africa)
console.log(af.getWeekInfo()); // { firstDay: 7, weekend: [6, 7], minimalDays: 1 }

const enGB = new Intl.Locale("en-GB"); // English (United Kingdom)
console.log(enGB.getWeekInfo()); // { firstDay: 1, weekend: [6, 7], minimalDays: 4 }

const arAF = new Intl.Locale("ar-AF"); // Arabic (Afghanistan)
console.log(arAF.getWeekInfo()); // { firstDay: 6, weekend: [4, 5], minimalDays: 1 }

const dvMV = new Intl.Locale("dv-MV"); // Divehi (Maldives)
console.log(dvMV.getWeekInfo()); // { firstDay: 5, weekend: [6, 7], minimalDays: 1 }

Specifications

Specification
Intl Locale Info Proposal
# sec-Intl.Locale.prototype.getWeekInfo

Browser compatibility

desktop mobile server
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
Bun
Deno
Node.js
getWeekInfo() method
Chrome – Full support
Chrome 99 (Release date: 2022-03-01)
footnote , altname
altname Alternate name: weekInfo
footnote Implemented as an accessor property.
Chrome – Full support
Chrome 130 (Release date: 2024-10-15)
footnote Full support
Edge – Full support
Edge 99 (Release date: 2022-03-03)
footnote , altname
altname Alternate name: weekInfo
footnote Implemented as an accessor property.
Edge – Full support
Edge 130 (Release date: 2024-10-17)
footnote Full support
Firefox – No support
Firefox
footnote No support
Opera – Full support
Opera 85 (Release date: 2022-03-23)
footnote , altname
altname Alternate name: weekInfo
footnote Implemented as an accessor property.
Opera – Full support
Opera 115 (Release date: 2024-11-27)
footnote Full support
Safari – No support
Safari 15.4 – TP (Release date: 2022-03-14)
altname
footnote Removed in TP and later
altname Alternate name: weekInfo
footnote Implemented as an accessor property.
Safari – Full support
Safari 17 (Release date: 2023-09-18)
footnote Full support
Chrome Android – Full support
Chrome Android 99 (Release date: 2022-03-01)
footnote , altname
altname Alternate name: weekInfo
footnote Implemented as an accessor property.
Chrome Android – Full support
Chrome Android 130 (Release date: 2024-10-15)
footnote Full support
Firefox for Android – No support
Firefox for Android
footnote No support
Opera Android – Full support
Opera Android 68 (Release date: 2022-03-30)
footnote , altname
altname Alternate name: weekInfo
footnote Implemented as an accessor property.
Opera Android – Full support
Opera Android 86 (Release date: 2024-12-02)
footnote Full support
Safari on iOS – Full support
Safari on iOS 15.4 (Release date: 2022-03-14)
footnote , altname
altname Alternate name: weekInfo
footnote Implemented as an accessor property.
Safari on iOS – Full support
Safari on iOS 17 (Release date: 2023-09-18)
footnote Full support
Samsung Internet – Full support
Samsung Internet 18 (Release date: 2022-08-08)
footnote , altname
altname Alternate name: weekInfo
footnote Implemented as an accessor property.
Samsung Internet – Full support
Samsung Internet 28 (Release date: 2025-04-02)
footnote Full support
WebView Android – Full support
WebView Android 99 (Release date: 2022-03-01)
footnote , altname
altname Alternate name: weekInfo
footnote Implemented as an accessor property.
WebView Android – Full support
WebView Android 130 (Release date: 2024-10-15)
footnote Full support
WebView on iOS – Full support
WebView on iOS 15.4 (Release date: 2022-03-14)
footnote , altname
altname Alternate name: weekInfo
footnote Implemented as an accessor property.
WebView on iOS – Full support
WebView on iOS 17 (Release date: 2023-09-18)
footnote Full support
Bun – Full support
Bun 1 (Release date: 2023-09-08)
footnote Full support
Deno – Full support
Deno 1.19 (Release date: 2022-02-17)
footnote , altname
altname Alternate name: weekInfo
footnote Implemented as an accessor property.
Deno – Full support
Deno 2.1 (Release date: 2024-11-21)
footnote Full support
Node.js – Full support
Node.js 18 (Release date: 2022-04-19)
footnote , altname
altname Alternate name: weekInfo
footnote Implemented as an accessor property.
Node.js – Full support
Node.js 24 (Release date: 2025-05-06)
footnote Full support
minimalDays in returned object
Deprecated
Chrome – No support
Chrome 99 – 135 (Release date: 2022-03-01)
footnote Removed in 136 and later
Edge – No support
Edge 99 – 135 (Release date: 2022-03-03)
footnote Removed in 136 and later
Firefox – No support
Firefox
footnote No support
Opera – No support
Opera 85 – 120 (Release date: 2022-03-23)
footnote Removed in 121 and later
Safari – Full support
Safari 15.4 (Release date: 2022-03-14)
footnote Full support
Chrome Android – No support
Chrome Android 99 – 135 (Release date: 2022-03-01)
footnote Removed in 136 and later
Firefox for Android – No support
Firefox for Android
footnote No support
Opera Android – No support
Opera Android 68 – 89 (Release date: 2022-03-30)
footnote Removed in 90 and later
Safari on iOS – Full support
Safari on iOS 15.4 (Release date: 2022-03-14)
footnote Full support
Samsung Internet – No support
Samsung Internet 18 – 28 (Release date: 2022-08-08)
footnote Removed in 29 and later
WebView Android – No support
WebView Android 99 – 135 (Release date: 2022-03-01)
footnote Removed in 136 and later
WebView on iOS – Full support
WebView on iOS 15.4 (Release date: 2022-03-14)
footnote Full support
Bun – Full support
Bun 1 (Release date: 2023-09-08)
footnote Full support
Deno – Full support
Deno 1.19 (Release date: 2022-02-17)
footnote Full support
Node.js – No support
Node.js 18 – 23 (Release date: 2022-04-19)
footnote Removed in 24 and later

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
No support
No support
Deprecated. Not for use in new websites.
Uses a non-standard name
Has more compatibility info.

See also