Intl.RelativeTimeFormat is undefined even if jscFlavor includes intl
See original GitHub issuePlease provide all the information requested. Issues that do not follow this format are likely to stall.
Description
console.log(Intl.RelativeTimeFormat) outputs undefined
even if I define in my app/build.gradle the jscFlavor = 'org.webkit:android-jsc-intl:+'
. The jscFlavor partially works because I can use the Intl.DateTimeFormat
with some options that weren’t working before the flavor change.
React Native version:
0.63.2
Expected Results
Intl.RelativeTimeFormat should be usable
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Using Intl properly in Android React Native app - Stack Overflow
Though it still says ReferenceError: Can't find variable: Intl . Then I gave up and tried to include custom JSC (I've confirmed that...
Read more >Intl.RelativeTimeFormat - JavaScript - MDN Web Docs - Mozilla
Returns an Array of objects representing the relative time format in parts that can be used for custom locale-aware formatting. Intl.RelativeTimeFormat.
Read more >Relative Date Internationalization In JavaScript
The formatter is specifically called Intl.RelativeTimeFormat . ... es-es for Spain spanish, or even undefined to infer the user's locale.
Read more >react-native-v8 - Bountysource
There are still some tweaks to publish as library. ... and adding the intl in the jscFlavor, the Intl.RelativeTimeFormat isn't available yet (is...
Read more >Intl.RelativeTimeFormat details - ECMAScript Proposals
Popular localization libraries like Moment.js, Format.js, Globalize, and others have implemented a formatting process for relative time values as well. It is ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
For anyone else having this issue, I was able to get it to work by installing the following poyfills:
yarn add @formatjs/intl-locale @formatjs/intl-relativetimeformat
And then in the entry point for my app I added the following:
You will need to follow these steps after you change the jsc flavor in the app gradle to use the
'org.webkit:android-jsc-intl:+'
flavor.Thanks for sharing @podenborg
Closing as a workaround was suggested 👍