Intl.Locale.prototype.weekInfo

Limited availability

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

La propriété Intl.Locale.prototype.weekInfo est un accesseur qui renvoie un objet weekInfo contenant les propriétés firstDay, weekend et minimalDays pour la locale associée.

Description

Renvoie les informations associées à l'instance Locale pour les informations sur la semaine selon les éléments de semaine UTS 35.

Exemples

Obtenir les informations sur la semaine

js
let he = new Intl.Locale("he");
console.log(he.weekInfo); // affiche {firstDay: 7, weekend: [5, 6], minimalDays: 1}

let af = new Intl.Locale("af");
console.log(af.weekInfo); // affiche  {firstDay: 7, weekend: [6, 7], minimalDays: 1}

let enGB = new Intl.Locale("en-GB");
console.log(enGB.weekInfo); // affiche  {firstDay: 1, weekend: [6, 7], minimalDays: 4}

let msBN = new Intl.Locale("en-GB");
console.log(msBN.weekInfo); // affiche {firstDay: 7, weekend: [5, 7], minimalDays: 1}
// Le week-end à Brunei est sur vendredi et dimanche mais pas sur samedi

Spécifications

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

Compatibilité des navigateurs

Report problems with this compatibility data on GitHub
desktopmobileserver
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
Deno
Node.js
getWeekInfo

Legend

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

Full support
Full support
No support
No support
See implementation notes.
Uses a non-standard name.
Has more compatibility info.

Voir aussi