-
Notifications
You must be signed in to change notification settings - Fork 648
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 date function returns the wrong date for "Asia/Singapore" timezone and 1981 and older years #1485
Comments
|
|
I think this is. bug in Hermes which implements I18n. |
Hey @nlyzhov-spotnana, thanks for reporting this. I can reproduce the behaviour you're seeing. The issue seems to be that the timezone in Singapore changed in 1982 from +0730 to +0800. When we initially construct the date, we use the current timezone of +0800, but when converting it back to a localised string, the Intl implementation correctly uses the older timezone of +0730. We'll look into this. |
Hey @neildhar , any update on the fix ? |
Hey @cipolleschi , @cortinico , @neildhar , any update on this ? |
Please don't ping us every week (especially consider user's statues like mine - busy). |
Description
Hello. Recently we got a bug for showing dates, where the date was shown with -1 day. During the investigation, the issue is found only in
Asia/Singapore
timezone and only for dates 1981 and older. The reason for this bug is thattoLocaleString
converts the timezone wrong, it gives 11.30 pm of the previous day instead of 12.00 am of the current day.This bug is only on mobile, the web shows the correct date.
The date returned from (new Date('1979-01-24T00:00:00').toLocaleString() :
Web: 01/24/1979, 12:00:00 AM
Mobile: 01/23/1979, 23:30:00 PM
Steps to reproduce
Singapore
Refresh the app
Check the
oldLocale
variable in the app: it showsoldLocale: 12/31/1980, 11:30:00 PM
React Native Version
0.72 - 0.74
Affected Platforms
Runtime - Android, Runtime - iOS
Output of
npx react-native info
Stacktrace or Logs
Reproducer
https://snack.expo.dev/pJ9xRMNJBfGg39ajN7uDv
Screenshots and Videos
The text was updated successfully, but these errors were encountered: