-
Notifications
You must be signed in to change notification settings - Fork 8
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
Incompatibility with @formatjs/datetimeformat polyfill #38
Comments
@Titozzz as I understand the error happens because |
Yes iOS 15.4 or below has that issue, but the polyfill is supposed to address that, as it is supposed to fill the gaps to match the spec. Here the issue that I'm pointing at is that even the polyfill doesn't fix the issue, which mean that either the polyfill or this library is wrong |
exactly. This is the polyfill issue. |
Until formatjs polyfills is fixed to correctly handle the above use case, I implemented a temporary fix for date-fns/tz package - see #23 (comment) I can create a PR for |
When polyfilling Intl.DateTimeFormat with @formatjs/datetimeformat and using tzOffset, 2 issues arise:
https://github.com/formatjs/formatjs/blob/main/packages/ecma402-abstract/IsValidTimeZoneName.ts#L6
https://github.com/date-fns/tz/blob/main/src/tzOffset/index.ts#L20
The timezone format isn't supported by the polyfill (that is supposed to cover 100% of the spec),
-> So who's correct ? Does the format here or there needs fixing ?
The cache that's added to prevent performance issues is not working when the method throws, so it will try to recreate a new format function on every call, harming performance seriously when using a JS engine that is slow regarding Intl APIs (hermes on react native)
Fixing 1) would mean 2) doesn't affect me anymore but we could still address the issue to not retry and crash everytime.
I'm open to addressing those issues in a PR, but just making just we are aligned first, thanks!
Linked issue in the other repo: formatjs/formatjs#4804
The text was updated successfully, but these errors were encountered: