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
{{ message }}
Repository navigation
With Hermes engine, certain date formats crash on production but works in debug #26187
changed the title [-]RN60 certain date formats crash on production but works in debug[/-][+]With Hermes engine certain date formats crash on production but works in debug[/+]on Aug 26, 2019
changed the title [-]With Hermes engine certain date formats crash on production but works in debug[/-][+]With Hermes engine, certain date formats crash on production but works in debug[/+]on Aug 26, 2019
I'm seeing this also. A date in ISO format like Fri, 06 Sep 2019 18:45:29 +0000 (UTC) parses as an Invalid Date in Hermes. It works on iOS and was working in Android in 0.59. I am now using Moment as a workaround but this should be supported natively.
Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as a "Discussion" or add it to the "Backlog" and I will leave it open. Thank you for your contributions.
Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to create a new issue with up-to-date information.
Activity
[-]RN60 certain date formats crash on production but works in debug[/-][+]With Hermes engine certain date formats crash on production but works in debug[/+][-]With Hermes engine certain date formats crash on production but works in debug[/-][+]With Hermes engine, certain date formats crash on production but works in debug[/+]radko93 commentedon Aug 26, 2019
Are you testing on debug without remote debugging enabled? Because then you are using Chrome to run JS code.
roydipti23 commentedon Aug 27, 2019
@radko93 debug JS remotely is enabled. And this same format was working previously in production before Hermes.
export function getDateFormat(date = 'Jul 18, 2018' ) {
const newDate = new Date(date);
return newDate;
}
henrymoulton commentedon Aug 27, 2019
I'd recommend looking at using Moment.js. JavaScript engines differ in how they treat Date objects: https://www.freecodecamp.org/news/get-to-know-different-javascript-environments-in-react-native-4951c15d61f5/
radko93 commentedon Aug 27, 2019
@roydipti23 Chrome treats dates differently than Hermes. If you want to test in debug mode turn off remote Chrome debugging.
HarshitMadhav commentedon Sep 2, 2019
@roydipti23 try using moment js for the same
jmeistrich commentedon Sep 8, 2019
I'm seeing this also. A date in ISO format like
Fri, 06 Sep 2019 18:45:29 +0000 (UTC)parses as an Invalid Date in Hermes. It works on iOS and was working in Android in 0.59. I am now using Moment as a workaround but this should be supported natively.stale commentedon Dec 7, 2019
Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as a "Discussion" or add it to the "Backlog" and I will leave it open. Thank you for your contributions.
stale commentedon Dec 14, 2019
Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to create a new issue with up-to-date information.