-
Notifications
You must be signed in to change notification settings - Fork 24.3k
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 support polyfill fails to load timezones on Android on 0.59.10 #25595
Comments
Linked issue in Luxon: moment/luxon#541 |
It looks like you are using an older version of React Native. Please update to the latest release, v0.60 and verify if the issue still exists. The "Resolution: Old Version" label will be removed automatically once you edit your original post with the results of running `react-native info` on a project using the latest release.
|
I can't upgrade to 0.60 due to a whole host of issues affecting dependent packages. I do need to upgrade to 0.59 though for the 64 bit support which is due next month. |
Ay carumba. |
As it turns out |
https://www.npmjs.com/package/date-time-format-timezone this helped me |
How did you import it into your app to make the Intl.DateTimeFormat method work for Android? When I tried importing it, I get an error that says that undefined is not an object (evaluating 'myGlobal.Intl.DateFormat') |
Intl polyfill has stopped working on
0.59.10
, after upgrading we found our app was producingInvalid DateTime
for all timezone related strings on Android.Diving more deeply, the following code crashes:
Intl.DateTimeFormat("en-US", { timeZone: 'America/New_York' }).format()
and produces
RangeError: timeZone is not supported
Package.json includes:
and Root.js has:
React Native version:
info
React Native Environment Info:
System:
OS: macOS 10.14.4
CPU: (8) x64 Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz
Memory: 834.63 MB / 16.00 GB
Shell: 5.3 - /bin/zsh
Binaries:
Node: 11.12.0 - /usr/local/bin/node
Yarn: 1.16.0 - ~/.yarn/bin/yarn
npm: 6.10.0 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 12.2, macOS 10.14, tvOS 12.2, watchOS 5.2
Android SDK:
API Levels: 22, 23, 24, 25, 26, 27, 28
Build Tools: 22.0.1, 24.0.0, 27.0.3, 28.0.3, 29.0.0
System Images: android-24 | Android TV Intel x86 Atom, android-24 | Intel x86 Atom, android-24 | Intel x86 Atom_64, android-28 | Google Play Intel x86 Atom
IDEs:
Android Studio: 3.4 AI-183.6156.11.34.5522156
Xcode: 10.2.1/10E1001 - /usr/bin/xcodebuild
npmPackages:
react: 16.8.3 => 16.8.3
react-native: ^0.59.10 => 0.59.10
npmGlobalPackages:
create-react-native-app: 0.0.6
react-native-cli: 2.0.1
react-native-git-upgrade: 0.2.7
Steps To Reproduce
intl
polyfillimport 'intl'
to your Root.jsIntl.DateTimeFormat("en-US", { timeZone: 'America/New_York' }).format()
Describe what you expected to happen:
App should not crash on lookup of the timezone string.
The text was updated successfully, but these errors were encountered: