Skip to content

Intl.DateTimeFormat options object is missing properties #47700

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

Closed
tefricker opened this issue Feb 2, 2022 · 1 comment
Closed

Intl.DateTimeFormat options object is missing properties #47700

tefricker opened this issue Feb 2, 2022 · 1 comment

Comments

@tefricker
Copy link

Bug Report

πŸ”Ž Search Terms

'DateTimeFormat', 'Intl'

πŸ•— Version & Regression Information

This is the behavior in every version I tried, and I reviewed the FAQ for entries about Intl.DateTimeFormat

⏯ Playground Link

Playground link with relevant code

πŸ’» Code

const date = new Date();

const formatted = new Intl.DateTimeFormat('en', {
			dateStyle: 'short',
			timeStyle: 'short',
		}).format(date);

console.log(formatted);

πŸ™ Actual behavior

Intl.DateTimeFormat options object is missing properties.

πŸ™‚ Expected behavior

Intl.DateTimeFormat options object should have types for dateStyle and timeStyle

@MartinJohns
Copy link
Contributor

Your target is set to ES2017, but this target does not support these properties. When you change your target to ES2020 it will work. See also #44632.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants