v130 · javascript
relaunch Intl Locale Info feature in newly added functions
Intl Locale Info API is a new Stage ECMAScript TC39 proposal to enhance the Intl.Locale object by exposing Locale information, such as week data (first day in a week, weekend start day, weekend end day, minimun day in the first week), and text direction hour cycle used in the locale. https://github.com/tc39/proposal-intl-locale-info We launch Intl Locale
concepts
-
Intl Locale Info inspector
Inspect
getCalendars(),getHourCycles(),getNumberingSystems(),getWeekInfo()output for any locale — the relaunched function-style API. -
Locale-aware calendar grid
The motivation made visible: render an actual calendar using
getWeekInfo()data. Pick a locale and the first column shifts, the weekend bands move (Fri–Sat in ar-SA, Thu–Fri in fa-IR), and ISO week numbers recompute fromminimalDays. -
Locale matrix (12 × 6 live grid)
Twelve locales × six newly-added accessors (
.calendars,.collations,.hourCycles,.numberingSystems,.timeZones,.textInfo). Each cell is a live API call running on your browser; click any cell to inspect the raw return value. Add your own locale tag to expand the matrix. -
Week format playground
Pick any locale (or type your own tag) and see
getWeekInfo()rendered as a live calendar strip — first day highlighted in blue, weekend days shaded,minimalDaysdisplayed. A cross-locale table compares eight locales side-by-side. -
Text Direction via getTextInfo()
Pick from 15 locales and see
locale.getTextInfo()return{ direction: 'rtl' }or'ltr'. A sample text renders in the correct direction; a full comparison table lists all 15 locales and their directions. -
World Clock via getTimeZones()
A live clock grid using
locale.getTimeZones()to obtain the canonical timezone for each locale. Clocks update every second viaIntl.DateTimeFormat; add any BCP-47 locale tag to add a new clock card.
why it shipped
Intl Locale Info API is a new Stage ECMAScript TC39 proposal to enhance the Intl.Locale object by exposing Locale information, such as week data (first day in a week, weekend start day, weekend end day, minimun day in the first week), and text direction hour cycle used in the locale. https://github.com/tc39/proposal-intl-locale-info We launch Intl Locale