Open gorbypark opened 3 years ago
It's a known issue. See https://github.com/facebook/hermes/issues/23
With Hermes, you can use date-fns + @ui-kitten/date-fns
packages
Ok, thanks for the suggestion. There seems to be a lack of information on how to actually use the @ui-kitten/date-fns
package. I've tried the follow:
yarn add date-fns @ui-kitten/date-fns
import dateFns from "@ui-kitten/date-fns"
...
<Calendar
dateService={dateFns}
date={date}
onSelect={(nextDate) => {
console.log(nextDate);
setDate(nextDate);
setIsDateModalVisible(false);
}}
/>
I get no error but the output of Calendar is still the same UTC based date as before..picking May 31 for example on Hermes and with @ui-kitten/date-fns
gives me 2021-05-30T22:00:00.000Z
while on jsc/web I get Mon May 31 2021 00:00:00 GMT+0200 (Central European Summer Time)
.
🐛 Bug Report
When running UI Kitten on Hermes (both iOS and Android) the returned date from the datepicker and calendar components is UTC formatted, while on non-Hermes engines (JSC and web) the date is returned in the local time zone. This is most likely due to the lack of intl support in Hermes.
To Reproduce
Pick a date using Datepicker or Calendar using Hermes.
Expected behavior
In my opinion, I think the components should return a consistent date across all platforms. Ideally, a polyfill could be created to support returning local timezone dates on Hermes.
UI Kitten and Eva version
Environment information