You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For very old dates, such as "0004-04-13T00:00:00Z", the .toLocaleString() will make the date string off by two days. i.e. it will be April 15 instead of April 13.
I have run gradle clean and confirmed this bug does not occur with JSC
The issue is reproducible with the latest version of React Native.
Hermes git revision (if applicable):
React Native version: 0.76
OS: iOS and Android
Platform (most likely one of arm64-v8a, armeabi-v7a, x86, x86_64): all
Seems like leap years are also possibly not counted correctly before 1582, as the days start shifting with every 100 years we go back from 1582. (except on 1100, 700, 300)
tom-un
changed the title
Date.toLocaleString() is off by 2 days for old dates.
Date.toLocaleString() is off by 2 days for dates before 1582.
Nov 26, 2024
Bug Description
For very old dates, such as "0004-04-13T00:00:00Z", the .toLocaleString() will make the date string off by two days. i.e. it will be April 15 instead of April 13.
gradle clean
and confirmed this bug does not occur with JSCHermes git revision (if applicable):
React Native version: 0.76
OS: iOS and Android
Platform (most likely one of arm64-v8a, armeabi-v7a, x86, x86_64): all
Steps To Reproduce
Go to https://reactnative.dev/docs/tutorial.
Paste the following:
Switch to Android or iOS.
The Expected Behavior
Date should be 4/13.
Instead its 4/15.
The text was updated successfully, but these errors were encountered: