-
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
toLocaleString is only working on ios not android. #15717
Comments
Hey, thanks for reporting this issue! It looks like your description is missing some necessary information, or the list of reproduction steps is not complete. Can you please add all the details specified in the template? This is necessary for people to be able to understand and reproduce the issue being reported. I am going to close this, but feel free to open a new issue with the additional information provided. Thanks! |
Dude, there's no missing information. toLocaleString() is a Javascript number formatting string method that just doesn't work at all on android. Please fix this |
Hi all, I am also facing the same issue in Android although it is working fine in iOS. |
I've noticed, that .toLocaleString does weirdly only work in JS Debug Mode on Android |
Any update? |
I'm using version |
Hi all, I am also experiencing this issue on android although it works fine in IOS. |
I have the same issue. Works fine on iOS but not Android. On Android the Expo app on the device will crash when I try to call it |
This should be re-opened @hramos , this is a real bug. |
Same here, work fine on iOS and only in debug-mode on Android. Any workaround for the meantime? |
@tzig You can try using react-native-globalize if you don't mind using an extra library in your app. |
This issue was so terribly closed, such an easy to see bug and they still want us to create templates to show that a simple JS function wont work on a specific OS.... terrible. I'm on react native 0.50.3 and I got the same issue |
There is an other open issue for this bug with their prefered template: #16867. Hope they don't close it. |
Same issue. Not very reassuring that the RN team will address this. |
@abhandaru I've been using https://github.com/smirzaei/currency-formatter for currencies, which works well on iOS and Android. |
I had the same problem on Android; using toLocaleDateString() instead seems to work. Since I only was interested in the date part and not the time part, that was enough for me. I would assume, though, that for complete date and time results a combination of toLocaleDateString() and toLocaleTimeString() would work |
This is an issue still, with numbers: They are formatting correctly in iOS, not in Android. |
@ferdicus this is likely due to the JavaScript engine being used. Normally RN will use JavaScriptCore. However while debugging under chrome debugging, it has to use V8. Though I thought JavaScriptCore supported this feature. So there must be more to this puzzle. This issue being closed looks silly. Is this resolved in RN 0.55.3? |
Work around solution is: |
☝️ I opened a new issue for this and sacrificed a small goat to the template gods 😬 |
In my way that solve this problem was this, I hope to help: var today = new Date(); |
It's a real shame, to those who are using `
} |
Shameful. |
Here is the workaround I use.
|
Still having this. |
Still face with this problem. it's only work in debug mode. it's too weird |
Guys it's clear it still exists! cause there is no new release and also no one is taking care about this thread :| So don't repeat this message please. |
The root cause here is the outdated JSC runtime that React Native Android ships with. It isn't something that can be easily patched; so there isn't going to be a PR specifically for this -- but there is a wider discussion around migrating to either a newer JSC version or allowing users to bundle any arbitrary JSC here. If and when the JSC ever gets updated, this should work as expected on both platforms. But until then, you have two options.
|
still not fixed, hehe, niiiiiiice |
toLocaleString is only working on ios and not android.
When will this be supported?
The text was updated successfully, but these errors were encountered: