-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Timezone startOf DST off-by-one #1437
Comments
I tried going back to 1.9.6 and just found a bunch of other issues with timezones. If anyone is using the timezone plugin in production they're in for a ride! |
Responding to this comment on the PR here: #1352
Not sure I'd use the terminology "worse". The PR did fix a bug when working with dates that have different offsets (i.e. DST ended or began since the current date and the specified date). That much is confirmed and there are a few issues that it resolved. Now, you may be right that it introduced a different bug.
Looking at your first block of code above (I've quoted it for reference), I tried to reproduce it using the same version I'm not getting the same results. I've posted the code I'm using below. The April 1st date is fine, I get the same result. But for April 15th, I get So, the result appears to be correct to me. Can you explain why you think that's incorrect? Now, if you can give a snippet of code where you get
|
@addisonElliott here's a codesandbox that reproduces what i'm seeing with 1.10.4: https://codesandbox.io/s/sad-wiles-mx6do?file=/src/App.js I very much wish I was getting the results you are :P Edit: here's a screenshot in case the output is different to you somehow |
Can you save your changes? I'm not seeing the content in the div. It's just the regular "Hello CodeSandbox" Disregard. Had to refresh my browser. I'm not getting the same results. I'm going to try changing my timezone to yours. I think that's the issue. |
Very interesting. I'm in the same timezone as the example (Australia/Melbourne). I just tried it again with a few different timezones by changing the Sensor Location in Chrome DevTools and always get this same result. |
@addisonElliott I've just realised, you are correct about #1352 (comment) as +10 is expected outside of DST. Let me run this dev version against our own apps tests. I noticed a few other things happening but now i'm second guessing myself! |
👍 That works. Here's what I've found so far. If I change my local timezone to Australia/Melbourne, the issue persists. Even when I changed my timezone to UTC it persists. But when I'm on my regular timezone of America/Chicago, the problem isn't there. I'm not sure what Chrome devtools does under the hood, but I'm not sure if that's enough to reproduce the issue. You might have to change your actual clock time on your machine. Anyway, while on the Melbourne timezone, I did some debugging to see what the contents of the date are. Finding 1This is using April 1st to show what the date looks like. Offset and local offset are correct at +11. Date itself appears correct too.
Finding 2Now doing this at April 15th. Everything still is correct. Offset is +10.
Finding 3Here I did Here's what I notice that's wrong:
SummaryThat's as far as I got debugging. Something is up with the I don't have any time left today to debug this, but hopefully that gets you on the right track. |
I'm now almost certain the issues i've been seeing today disappear on dev thanks to this PR #1352 Our test suite runs a bunch of bookings across different timezones and they're all green. Looking forward to the next release, and thanks for your help. Where do I send money to support this lib? |
That makes sense. I didn't make the connection that the PR hasn't been released yet. 🤷♂️ Not sure where to send it. I just follow a few issues that I'm familiar with and try to help if there's any issues. |
@iamkun do you have any ETA plans for a new release? The |
+1 on this, would have to have to revert to moment.js because of this! |
Unfortunately, as long as this error is in place I have to postpone the migration from moment.js |
I updated to the version 1.10.5. It seems though that the problems with the timezones and DST are only partly solved. |
@apm78 day-js timezone support is insanely broken. The docs make it seem like timezone support is production ready but it's literally a single ~80 line file that barely covers anything. I'm not very knowledgeable with timezones so it's hard for me to contribute, but strategically I think this repo should:
I spent literally weeks adding day-js to a new platform before realising these issues existed and then spent literally days swapping it back out for Moment.js |
I don't use the timezone functionality extensively. Primarily I utilize UTC timestamps for timestamping things, so I haven't noticed any issues. I'm not sure I'd agree with it being "insanely broken", but broken nonetheless. My understanding there are a few outstanding bugs regarding timezones that are causing some headaches. These are likely small & simple fixes waiting to be investigated. |
In Australia DST ends on the 4th of April 2021.
Using the timezone plugin and v1.10.4 (latest):
Curiously, the changelog mentions this issue was fixed in v1.9.7, so I switched to 1.9.6 to test this and it seems to be working correctly:
Is anyone up for fixing this? I'll throw a $100 bounty down. Surely there are some others who also need this fixed and want to add to the pool!
The text was updated successfully, but these errors were encountered: