demo · v130
Intl.Locale info methods
Pick or type a locale tag, and see the new method-style accessors return arrays for calendars, hour cycles, numbering systems, weekend, and time zones. These replace the older getter-style properties.
method-style (v130)
previous getter-style
the code
const l = new Intl.Locale("en-GB");
// v130: method-style accessors
l.getCalendars(); // ["gregory"]
l.getHourCycles(); // ["h23"]
l.getNumberingSystems();// ["latn"]
l.getTimeZones(); // ["Europe/London"]
l.getWeekInfo(); // { firstDay: 1, weekend: [6,7], minimalDays: 4 }
// Previous getter-style still works on most engines:
l.calendars; l.hourCycles; l.numberingSystems; l.timeZones; l.weekInfo;
see also
- Intl Locale Info methods — feature index
- ChromeStatus entry
- TC39 proposal