Intl.Locale.prototype.weekInfo
The weekInfo
accessor property of Intl.Locale
instances returns a weekInfo
object with the properties firstDay
, weekend
and minimalDays
for this locale.
Description
Returns the Locale
information associated with the Locale data specified in UTS 35's Week Elements..
Examples
Obtaining the Week Information
Return the week information for a given Locale
.
const he = new Intl.Locale("he");
console.log(he.weekInfo); // { firstDay: 7, weekend: [5, 6], minimalDays: 1 }
const af = new Intl.Locale("af");
console.log(af.weekInfo); // { firstDay: 7, weekend: [6, 7], minimalDays: 1 }
const enGB = new Intl.Locale("en-GB");
console.log(enGB.weekInfo); // { firstDay: 1, weekend: [6, 7], minimalDays: 4 }
const msBN = new Intl.Locale("ms-BN");
console.log(msBN.weekInfo); // { firstDay: 7, weekend: [5, 7], minimalDays: 1 }
// Brunei weekend is Friday and Sunday but not Saturday
Specifications
Specification |
---|
Intl Locale Info Proposal # sec-Intl.Locale.prototype.weekInfo |
Browser compatibility
BCD tables only load in the browser