Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Signature for toLocale[X]String is missing Intl.Locale #47802

Closed
anddoutoi opened this issue Feb 8, 2022 · 0 comments · Fixed by #47811
Closed

Signature for toLocale[X]String is missing Intl.Locale #47802

anddoutoi opened this issue Feb 8, 2022 · 0 comments · Fixed by #47811
Labels
Bug A bug in TypeScript Domain: lib.d.ts The issue relates to the different libraries shipped with TypeScript Help Wanted You can do this
Milestone

Comments

@anddoutoi
Copy link

anddoutoi commented Feb 8, 2022

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

Screenshot 2022-02-08 at 13 06 29

Screenshot 2022-02-08 at 13 06 17

🙂 Expected behavior

TS should allow for Intl.Locale.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript Domain: lib.d.ts The issue relates to the different libraries shipped with TypeScript Help Wanted You can do this
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants