-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
Intl DateTimeFormatOptions Missing Properties #38266
Comments
This issue has been marked as a 'Duplicate' and has seen no recent activity. It has been automatically closed for house-keeping purposes. |
@RyanCavanaugh I don't believe this is a duplicate as it's talking about adding missing parameters. The referenced ticket proposes using string literal types to match the exact values allowed, which would be a potential breaking change. I think that would be avoided here when adding these missing parameters. |
I'm also experiencing a issue with the fact, In the MDN docs we can see the should exist in the |
I am also encountering this issue, with the 'timeStyle' and 'dateStyle' options |
Same here with the 'timeStyle' ! |
same here with timeStyle + dateStyle ! Also one odd thing I found was
|
@amychang0401 seems like
So while using Intl.DateTimeFormat there are 2 options — to use |
Bump, still facing this problem...
|
After reading the MDN docs I think that this lack of properties is intencional because Safari doesn't support those configurations, like illustrated in the figure above: But idk, maybe it has other explanation. Here is other table with more descritive informations about the options object of Intl that says the same thing: |
Just noticed an issue with "fractionalSecondDigits". I am using Node v14.16.0 so there is support for it: Object literal may only specify known properties, and 'fractionalSecondDigits' does not exist in type 'DateTimeFormatOptions'. Typescript is 4.1.5 I'll work around it but just something else to be added to the library. |
Looks like |
@RyanCavanaugh can you explain why this was marked as a duplicate this issue is requesting that new fields be added to DateTimeFormatOptions #35865 is requesting that existing fields be made more strict |
Hi guys,
I'm using Intl.DateTimeFormat to format some database dates into human readable format. TS is throwing an error:
I noticed that the TS documentation here does not reflect all the options present here
I tried searching the issues but i did not see anything about this specifically. Is this known/intentional? Could I make a quick pr to add the options to the
DateTimeFormatOptions
interface, if not?Thanks
TypeScript Version: 3.8.3
Search Terms:
DateTimeFormatOptions, DateTimeFormat
Code
Expected behavior:
dayPeriod
is exposed in theDateTimeFormatOptions
interfaceActual behavior:
Error is thrown because
dayPeriod
is not present inDateTimeFormatOptions
Playground Link:
playground
The text was updated successfully, but these errors were encountered: