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

TypeScript version incorrectly lists Intl.DateTimeFormat Parameter Options #46852

Closed
Guergeiro opened this issue Nov 18, 2021 · 2 comments
Closed
Labels
Duplicate An existing issue was already created

Comments

@Guergeiro
Copy link

Bug Report

As per MDN the option fractionalSecondDigits should accept 0, 1, 2, 3 which is not being respected by the latest TypeScript version.

🔎 Search Terms

DateTimeFormat
Intl.DateTimeFormat
fractionalSecondDigits
options

🕗 Version & Regression Information

  • This changed between versions 4.4.4 and 4.5.2.

⏯ Playground Link

Playground link with relevant code

💻 Code

const date = new Date();
const str = date.toLocaleDateString("en-US", {
  fractionalSecondDigits: 3 // This is not allowed
});

🙁 Actual behavior

Doesn't work.

🙂 Expected behavior

Allow this behaviour.

@ilogico
Copy link

ilogico commented Nov 18, 2021

I had the same issue, the solution is to have ES2021 or ES2021.Intl in your lib setting.
See #42944

@RyanCavanaugh RyanCavanaugh added the Duplicate An existing issue was already created label Nov 18, 2021
@Guergeiro
Copy link
Author

I had the same issue, the solution is to have ES2021 or ES2021.Intl in your lib setting. See #42944

Makes sense. Thanks @ilogico!

@RyanCavanaugh you can close this issue if needed 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Duplicate An existing issue was already created
Projects
None yet
Development

No branches or pull requests

3 participants