Intl.Locale.prototype.weekInfo
The Intl.Locale.prototype.weekInfo
property is an accessor property which returns a weekInfo
object with the properties firstDay
, weekend
and minimalDays
for the associated 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
.
let he = new Intl.Locale("he"); console.log(he.weekInfo); // logs {firstDay: 7, weekend: [5, 6], minimalDays: 1} let af = new Intl.Locale("af"); console.log(af.weekInfo); // logs {firstDay: 7, weekend: [6, 7], minimalDays: 1} let enGB = new Intl.Locale("en-GB"); console.log(enGB.weekInfo) // logs {firstDay: 1, weekend: [6, 7], minimalDays: 4} let msBN = new Intl.Locale("en-GB"); console.log(msBN.weekInfo) // logs {firstDay: 7, weekend: [5, 7], minimalDays: 1} // Brunei weekend is Friday and Sunday but not Saturday
Specifications
No specification data found for javascript.builtins.Intl.Locale.weekInfo
.
Check for problems with this page or contribute a missing spec_url
to mdn/browser-compat-data. Also make sure the specification is included in w3c/browser-specs.
Browser compatibility
No compatibility data found for javascript.builtins.Intl.Locale.weekInfo
.
Check for problems with this page or contribute missing data to mdn/browser-compat-data.
See also
© 2005–2021 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/weekInfo