React Native: Formatting token HH does not work correctly if it is midnight
format(date, "YYYY-MM-DD HH:mm") returns 2024-09-10 0:00 instead of 2024-09-10 00:00
what is your locale?
es
Hmm, struggling to reproduce this:
Perhaps you could provide more information on your system, and maybe a video of the issue on the tempo website?
React Native app with Expo SDK 51 running on an Android device.
"@formkit/tempo": "^0.1.2", "expo": "~51.0.28", "react": "18.2.0", "react-native": "0.74.5",
let dateParsed = parse("2024-09-10 00:00:00", "YYYY-MM-DD HH:mm:ss", "es"); // 2024-09-09T22:00:00.000Z let dateFormatted = format(dateParsed, "DD-MM-YYYY HH:mm", "es"); // 10-09-2024 0:00
It seems the problem is that the JS engine included with Android is simplified and lacks many UI-focused APIs, as headless JS engines tend to be used for non-UI purposes, so there is no need to add more UI to it. Therefore, it does not have the Intl. API available.
Perhaps this Stack Overflow might help? React-Native and Intl polyfill required on Android device
Yes, thank you very much.