microsoft / TypeScript

TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
https://www.typescriptlang.org
Apache License 2.0
101.26k stars 12.52k forks source link

`Intl.Locale.prototype.getTimeZones()` is missing from Intl library definitions #60496

Open oscar-b opened 2 weeks ago

oscar-b commented 2 weeks ago

⚙ Compilation target

ESNext

⚙ Library

ESNext

Missing / Incorrect Definition

Intl.Locale.prototype.getTimeZones() doesn't exist in the Intl library definitions. It is supported in all browsers except Firefox.

Sample Code

const loc = new Intl.Locale("en-US");
const localeTimeZones = loc.getTimeZones();

Documentation Link

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/getTimeZones

https://tc39.es/proposal-intl-locale-info/#sec-Intl.Locale.prototype.getTimeZones