Skip to content
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

fix: Fix timezone Date parsing for Hermes JS engine #2843

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

milesingrams
Copy link

When using the Hermes engine in the newer versions of React Native the timezone plugin doesn't work because there are a few places where the Date constructor is used to parse a en locale formatted date string and Hermes doesn't support that format of parsing (i.e. new Date('8/20/1999, 5:00:15 AM')). This issue results in the timezone plugin always returning GMT and UTC times when used in newer Expo and React Native apps. In order to work around this we can use dayjs itself to parse these dates instead of the native Date constructor. This PR allows dayjs to work in Expo and React Native with the timezone plugin.

@ndhunju
Copy link

ndhunju commented Mar 18, 2025

Wow I've been needing this!

@AustinStehling
Copy link

Can we get this merged before another dev loses their mind trying to debug this? 🚀🔥

Copy link

@ivashi ivashi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧠 !!!

@milesingrams
Copy link
Author

Similar to #2227 but I think simpler because it just uses dayjs itself to do the parsing here. Either works though!

@milesingrams
Copy link
Author

Also this Issue:
facebook/hermes#1519

@WonKimGoRevel
Copy link

🥇

@gabrielavoll
Copy link

Holy smokes he solved it !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants