Date.toLocaleDateString() ignores country settings on Android
See original GitHub issue- Provide a minimal code snippet / rnplay example that reproduces the bug.
let testDate = Date.UTC(2016, 6, 23, 10, 0, 0, 0);
let output = new Date(testDate).toLocaleDateString();
return <Text style={styles.text}>{output}</Text>;
https://rnplay.org/apps/bGMmOA
- Provide screenshots where appropriate
- go to phone settings and change the language to Deutsch (Deutschland)
- launch the app
Expected:
23.06.2016
Actual:
07/23/16
- What’s the version of React Native you’re using?
0.28
- Does this occur on iOS, Android or both?
only Android, on iOS this works fine.
- Are you using Mac, Linux or Windows?
Mac
Issue Analytics
- State:
- Created 7 years ago
- Reactions:9
- Comments:17 (4 by maintainers)
Top Results From Across the Web
Date.prototype.toLocaleDateString() - JavaScript | MDN
The toLocaleDateString() method returns a string with a language-sensitive representation of the date portion of the specified date in the ...
Read more >toLocaleDateString on Android returns wrong format
I use toLocaleDateString to get different date formats for different countries. But on Android then I pass, for example, 'fr-FR' or 'en-GB', ...
Read more >Date.prototype.toLocaleDateString()
In older implementations, which ignore the locales and options arguments, the locale used and the form of the string returned are entirely ...
Read more >en-non-US locale not causing correct date format on Mac OS X
(new Date).toLocaleDateString() seems to always return month/day/year, regardless of OS X setting. Did this work before? N/A Chrome version: 24.0.1312.52 ...
Read more >Date.prototype.toLocaleDateString() - JavaScript
The toLocaleDateString() method returns a string with a language sensitive representation of the date portion of this date. The new locales and options...
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 Free
Top 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
This definitely shouldn’t be closed.
new Date().toLocaleDateString()
still isn’t working correctly, and is really a basic feature.now seems use
new Date().toLocaleDateString()
crash directly in android huawei phone with 1.0.0, while it is ok in ios, usenew Date().toString()
ok