-
Notifications
You must be signed in to change notification settings - Fork 116
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
utcToZonedTime returns next day when time matches offset #38
Comments
Edit: see below |
Ok, I've looked into this more. The issue is restricted to Chrome Canary (I'm on 81.0.4039.0). It's specifically related to do with Intl.DateTimeFormat which is used in tzTokenizeDate.
I haven't found any Chrome issues about this, I don't know whether this is a Chrome bug or a change in behavior that is upcoming. But 24:00:00 is an invalid time surely, so probably just a bug that hopeufly gets squished before it gets full released. |
Ok final word! Sorry for using your issue queue for talking aloud to myself 😂 I filed a bug report with Chrome: https://bugs.chromium.org/p/chromium/issues/detail?id=1045791 |
Great @atomcorp. Thank you for submitting the Chrome bug report. At least you talk sense when speaking to yourself. 😛 |
The Chrome issue was closed and marked as WON'T FIX. I guess this bug needs to be fixed in this library? I have opened #41 since this issue was prematurely closed. |
Yeah think so! Chrome team's suggested fix eg: https://codepen.io/atomcorp/pen/KKwjpZR?editors=0010 I haven't had a chance to see what impact that change will have on |
Ok, so this is also affecting |
Removing the |
I just tried to create a PR with this, but the build and packaging process is all sorts of busted, with no documentation. I would love to help, so maybe someone could help me out with the build? thx |
OK, so I tested the fix which does work on Chrome 80. However, it breaks on Chrome < 73. So I tried changing the locale from Great work @hyyan, but that will cause other issues on Chrome < 73, which is not that old of a browser. |
Thank you all. This was a tricky one to solve. Thank you @hyyan for making a PR. I will review and merge over the weekend. |
Hi, experiencing this myself, but only on an Ubuntu Chrome browser, and no issue on a Mac Chrome. As a test case:
|
Ah! I do believe it's a Chrome 80 bug. I had Chrome 79 on my Mac, no issues. I just updated to 80, and now I see the bug. Just confirming. Thanks. |
@marnusw did you have the chance to review? |
Thanks again all. Please check out |
Hello, first of thanks for your work, dates are such a pain, I don't even want to think about working on a date library 😫
Anyway, I've come across this issue with date-fns-tz, I've tried to make a reduced issue here: https://codepen.io/atomcorp/pen/gObqoyX
In short the following returns a Date object for the 24th not 23rd
It seems to happen when the inputted time matches the offset of the timezone. So if you move the time of the inputted date an hour back or forward, so it's different to the timezone offset, both utcToZonedTime and the native method return the same.
Like I said times are weird, so maybe this is expected behaviour!? 🤷♂️
The text was updated successfully, but these errors were encountered: