demo · v143

Intl Locale Getters

Pick a locale. Each row calls the deprecated getter (e.g. .calendars) and the new method (e.g. .getCalendars()) on the live Intl.Locale object in your browser and shows what they return side by side.

info deprecated getter v143+ method equal?

If your engine has dropped the getters, the left column reads undefined. If it still has them, both columns match (until the deprecation warning ships).

the call

const l = new Intl.Locale("en-US");

// Deprecated in v143:
l.calendars;       // ["gregory"]
l.hourCycles;      // ["h12"]
l.numberingSystems;
l.weekInfo;

// Use these instead:
l.getCalendars();
l.getHourCycles();
l.getNumberingSystems();
l.getWeekInfo();

see also