-
Notifications
You must be signed in to change notification settings - Fork 130
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
Dst leap is passed on to subsequent occurrences of recuring events #648
Comments
"When an occurrence of a recurring event falls exactly on/in a DST transition, the subsequent occurrences are also shifted forward in time, though they should not be." "on/in" - just trying to be clearer that this problem happens when exactly at the time the transition "jumps" (usually 0200), or for any time in the "missing" hour (0201 to 0259 inclusive) And I wonder what happens for other "edge cases", like someone wants an event to start at 0100 and end at 0400 - on "normal" mornings the event has a duration of 3 hours. Should the event still happen from 0100 to 0400 on the summer time transition day, and only actually have a duration of 2 hours? (and when transitioning back at the end of summer time, the event would have a duration of 4 hours?) Maybe the expected behavior is specified in an RFC somewhere - I haven't looked for that yet! |
Yes please - what have you tried? |
Note for reference: https://datatracker.ietf.org/doc/html/rfc5545
so the "jump" to 0330 on the day when 0230 does not exist, that is the correct behavior for just that day. |
The issue is visible for any time between 2:00 am to 2:59 am inclusive. As you pointed out in you next comment with the rfc quote, that's the time range that does not occur and will result in a one hour "jump" forward. That jump is correct but it should be only on that event, not on subsequent occurrences. |
Here is what I tried: https://github.com/ProtonMail/vobject/pull/101/files note: this PR is on a fork that has diverged a bit In short the idea is to keep track of the "jump", and to subtract it at the next occurrence. I decided to abandon it because it didn't seem sufficiently robust or future proof. The implementation was aimed towards cases where there is a single time-modification per On top of that I was forced to re-implement substractDates() and substractIntervals() which feels wrong. I had to do so because the built-in functions would have an undesired behaviour right around the DST jump. |
Reverting the time after the fact is not ideal. In an ideal world I would rather see the code store the "raw" datetime, i.e. 2:15am inside |
Yes, the code/object should always "know" that the real desired time for the event is 0215, and whenever it finds that 0215 does not exist, it just jumps that one occurrence to happen at 0315, then continues on calculating more future dates on which the event will happen at 0215. (And it is possible that an event like this, that happens regularly at 0215, and runs for a few years, will have multiple occurrences that need to happen at 0315!) |
Google and Apple behave differently here.
I don't know which one is correct. |
And either is "correct" depending on what the user wants! For example, I have worked in places with 24hr shift rosters. On the time transition nights, an 8-hour shift would actually only be 7-hours elapsed time on one transition, and 9-hours elapsed time on the other transition. That allowed the day shift to start always at the same time on the local clock. But other organizations might want different behavior - there is no way to know, the RFC does not provide any way for the user to select which behavior they want. |
A recurring |
But because the RFC supports |
Fixed in release https://github.com/sabre-io/vobject/releases/tag/4.5.5 |
When an occurrence of a recurring event falls exactly on a DST transition, the subsequent occurrences are also shifted forward in time, though they should not be.
I reproduced this in: #647
I've explored a quick way of fixing it, but it was not robust enough. I can share more information if it helps
The text was updated successfully, but these errors were encountered: