-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Closed
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: lib.d.tsThe issue relates to the different libraries shipped with TypeScriptThe issue relates to the different libraries shipped with TypeScriptHelp WantedYou can do thisYou can do this
Milestone
Description
Bug Report
The signature for all toLocale[X]String()
should be changed to:
toLocaleString(locales?: string | string[] | Intl.Locale | Intl.Locale[], options?: Intl.DateTimeFormatOptions): string;
See locales argument at MDN and 9.2.1 CanonicalizeLocaleList from ECMA-402.
Edit: This works in plain JavaScript.
🔎 Search Terms
toLocaleString
toLocaleDateString
toLocaleTimeString
Intl.Locale
🕗 Version & Regression Information
- Tested in 4.5.2 and 4.5.4.
⏯ Playground Link
Playground link with relevant code
💻 Code
let now = new Date();
let svSE = new Intl.Locale("sv-SE");
now.toLocaleString(svSE);
🙁 Actual behavior
🙂 Expected behavior
TS should allow for Intl.Locale
.
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: lib.d.tsThe issue relates to the different libraries shipped with TypeScriptThe issue relates to the different libraries shipped with TypeScriptHelp WantedYou can do thisYou can do this