-
-
Notifications
You must be signed in to change notification settings - Fork 513
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 rezonedDate without luxon (commit: cf76af3) #547
fix rezonedDate without luxon (commit: cf76af3) #547
Conversation
@jakubroztocil would it be possible to get this released 🙏 Thanks! |
Would love to see this get merged too 👍 |
This fix works for me too, hope it get's merged. |
We need this correction too , it would be great to get it released 😃 |
I would appreciate if this one gets merged. Is there anything that can be done in order to speed up the merge and the release? |
@jakubroztocil is there anything I can help with to get that fix merged? 🙏 |
@jakubroztocil Can we merge this pull request asap please 🙏 Thanks ! |
Please @jakubroztocil if you can review it and merge. This is realy a bummer for us. It would be a pity to have to fork just for that... |
Why |
Thanks for contributing this PR! I'm seeing the test that was introduced failing, even with the code change, so that will need to be fixed before this PR can be merged. I'd like to see a failing test introduced illustrating the problem, then changes that fix that failing test (without changing the behavior of other tests). Additionally, I'm not convinced this is the right fix:
The |
Please can you tell me where you see it failing? If I remove the fix and just include the new test, I see
and
That error is caused because the value being split is Adding the fix, the tests work in both locales for me. |
Looks like there are some Prettier errors... |
Sorry, now fixed. Please approve workflow. |
extract dateInTimeZone() from rezonedDate() and add to dateutils.ts, so it can also be used by expectedDate().
I've fixed the expectedDates for the failing test. |
We could probably also use some new workflows in |
This fails for LANG=en_CA and LANG=sw_KE before rezonedDate() fix.
Rather than adding new workflows, I've just specified LANG corresponding to the specified TZ. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great & works on my machine (and in CI!). Thanks for your contribution!
Glad to help. |
fixes #523
The problem was introduced in #508 by commit: cf76af3 in
src/datewithzone.ts
:This relies on
new Date()
parsing the output ofdate.toLocaleString()
, but it only recognizes month/day/year, i.e. US date format. As the first parameter ofdate.toLocaleString()
isundefined
, the output will be in the host's locale. As I'm in London, that is en-GB which formats the date as day/month/year which causesnew Date()
to returnInvalid Date
.The solution is to explicitly specify the
en-US
locale instead ofundefined
.Thanks for contributing to
rrule
!To submit a pull request, please verify that you have done the following:
master
commitaddressing