admin管理员组文章数量:1345135
I've been using Luxon for quite sometime as a replacement for moment, being light weight and an overall great documentation, I've now bumped into a case where I needed to use luxon's toFormat function to write the date month name.
Now this problem only occurs in Android and not in iOS, I'm assuming because some of the javascript in iOS also es from Safari, and the browser does support Luxon's Intl API.
Basically my question is how do you make Luxon's Intl Api work on Android?
React-Native version: 0.62.2
I've been using Luxon for quite sometime as a replacement for moment, being light weight and an overall great documentation, I've now bumped into a case where I needed to use luxon's toFormat function to write the date month name.
Now this problem only occurs in Android and not in iOS, I'm assuming because some of the javascript in iOS also es from Safari, and the browser does support Luxon's Intl API.
Basically my question is how do you make Luxon's Intl Api work on Android?
React-Native version: 0.62.2
Share Improve this question edited Apr 24, 2020 at 13:48 Luís Mestre asked Apr 24, 2020 at 12:13 Luís MestreLuís Mestre 1,9381 gold badge14 silver badges31 bronze badges1 Answer
Reset to default 11So while I was writting my question I was still reading luxon's documentation and searching for any possible solution.
From Luxon's docs I was redirected to JSC Android Buildscripts
Which at first sight looked like a promising solution, while at the same time I had found an issue that was reported in react-native's github Fresh Install Android Broken on React Native 0.60 RC2
And basically by reading both sides I found that in the app/build.gradle file there's a variable called jscFlavor, which literally states
For example, to use the international variant, you can use:
def jscFlavor = 'org.webkit:android-jsc-intl:+'
Basically by changing the jscFlavor to 'org.webkit:android-jsc-intl:+' I was able to have Intl working in Android with Luxon
本文标签: javascriptHow to have Luxon39s Intl API working in ReactNativeStack Overflow
版权声明:本文标题:javascript - How to have Luxon's Intl API working in React-Native - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1743730255a2529059.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论