-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Error formatting time with timeStyle
#2410
Comments
Thanks for reporting this is indeed a bug historically in how we default certain options. Will fix soon. |
I was thinking this may have to do with the following defaults being added here: |
Yup removing that might be a breaking change but would be more consistent w native API |
dateStyle/timeStyle is used in formatTime fix #2410
latest version (being published rn) should have the fix |
Thanks for the amazingly quick response and fix! |
Which package?
@formatjs/intl
, more specifically: https://github.com/formatjs/formatjs/blob/main/packages/intl/src/dateTime.tsDescribe the bug
I did not set option
hour
and I receive the following error:Error formatting time. Can't set option hour when timeStyle is used.
To Reproduce
FormattedTime
componenttimeStyle="short"
Expected behavior
There should be no error. The time should format as expected.
Screenshots
https://codesandbox.io/s/fragrant-wildflower-uswse?fontsize=14&hidenavigation=1&theme=dark
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: