We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
@formatjs/intl-datetimeformat
__setDefaultTimeZone can not handle timezone passed as "Etc/UTC" and throws "Invalid timeZoneName" errror. Root case -
formatjs/packages/intl-datetimeformat/src/core.ts
Line 305 in 2a120fe
formatjs/packages/ecma402-abstract/CanonicalizeTimeZoneName.ts
Line 25 in 78d3558
Since IsValidTimeZoneName is called before CanonicalizeTimeZoneName can convert "Etc/UTC" to UTC, error is thrown.
Issue is reproducible on Android devices in React Native App
UTC +0
DateTimeFormat.__setDefaultTimeZone(tz)// "Etc/UTC"
DateTimeFormat.__setDefaultTimeZone("Etc/UTC") // will throw
It is expected that UTC timezone would be selected, based on
N/A
While IsValidTimeZoneName is by the spec - https://tc39.es/ecma402/#sec-isvalidtimezonename, it seems it does not account for "Etc/UTC" to "UTC" conversion, same way as
The text was updated successfully, but these errors were encountered:
c18ee8b
No branches or pull requests
Which package?
@formatjs/intl-datetimeformat
Describe the bug
__setDefaultTimeZone can not handle timezone passed as "Etc/UTC" and throws "Invalid timeZoneName" errror.
Root case -
formatjs/packages/intl-datetimeformat/src/core.ts
Line 305 in 2a120fe
formatjs/packages/ecma402-abstract/CanonicalizeTimeZoneName.ts
Line 25 in 78d3558
Since IsValidTimeZoneName is called before CanonicalizeTimeZoneName can convert "Etc/UTC" to UTC, error is thrown.
To Reproduce
Issue is reproducible on Android devices in React Native App
UTC +0
(for API 29-30 disable timezone from network, manually select UTC offset instead of region & city)Codesandbox URL
Expected behavior
It is expected that UTC timezone would be selected, based on
formatjs/packages/ecma402-abstract/CanonicalizeTimeZoneName.ts
Line 25 in 78d3558
Screenshots
N/A
Desktop (please complete the following information):
Smartphone (please complete the following information):
Additional context
While IsValidTimeZoneName is by the spec - https://tc39.es/ecma402/#sec-isvalidtimezonename, it seems it does not account for "Etc/UTC" to "UTC" conversion, same way as
formatjs/packages/ecma402-abstract/CanonicalizeTimeZoneName.ts
Line 25 in 78d3558
The text was updated successfully, but these errors were encountered: