-
Notifications
You must be signed in to change notification settings - Fork 126
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
Handle summer time jumps in event recurrences #653
Merged
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
b9c39da
Reproduce bug where dst leap is passed on to subsequent occurences
cyrilvanschreven-proton b37ef3d
Fix test code format
phil-davis 963189b
Handle summer time start for daily recurrences
phil-davis 2feab3f
Handle summer time start for weekly recurrences
phil-davis 3b37fbc
Handle summer time start for monthly recurrences
phil-davis f4a0bba
Handle summer time start for yearly recurrences
phil-davis 778177c
Refactor summer time start logic into advanceTheDate function
phil-davis fb5689a
Handle summer time start for hourly recurrences
phil-davis 018789e
Refactor advanceTheDate
phil-davis d0cb455
fix: refactor advanceTheDate
phil-davis eef9fa6
Handle case when BYMONTHDAY falls on summer time start
phil-davis 9b20d5e
Handle case when day at or near end of month falls on summer time start
phil-davis 102909e
refactor hourly time jump logic into adjustForTimeJumpsOfHourlyEvent …
phil-davis 85d72e0
refactor original start time calculation into startTime method
phil-davis cc112fb
refactor adjustForTimeJumpsOfHourlyEvent to be protected
phil-davis 9d68c7a
Handle summer time start for weekly BYDAY recurrences
phil-davis 5a3dd88
Add test case for Weekly BYDAY with BYHOUR on summer-time
phil-davis 9039f90
Add test cases and fix YEARLY with BYMONTH on summer-time transition
phil-davis 1d0d0bd
Add test cases and fix YEARLY with BYMONTH BYDAY on summer-time trans…
phil-davis File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Question: Should we not handle the execution going to the rest of the function as well? I would well see a line at the very end to set the time straight:
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.
This is a bit trickier. I will try have a look tonight. I just need to make sure that various BYDAY BYHOUR etc filters will skip along correctly while sometimes happening to hit a summer-time start day. There might be a few code paths to think about (or it might turn out to be easy!)
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.
I have done the scenario for WEEKLY BYDAY when the recurrence falls on Sunday at 0230.
It is trickier for:
FREQ=WEEKLY;INTERVAL=2;BYDAY=SA,SU;WKST=MO;BYHOUR=2,14
The RRULE says to schedule at 0200 and 1400 on each Saturday and Sunday.
On the Sunday of summer-time transition there is no 0200. The code current skips scheduling anything on the Sunday morning of summer-time transition. Future recurrences on later weekends are correctly scheduled at 0200 and 1400.
The "bug" in this case is not that the scheduled time gets locked forward to 0300, but that the recurrence on the summer-time transition day is not scheduled at all.
The RFC does not say anything about what is required if one of the hours mentioned in BYHOUR does not exist on the day in question.
I pushed a test case for now, that demonstrates the current behavior.
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.
@schreven I have handled all the cases that I could see where
nextWeekly
netMonthly
ornextYearly
have BYDAY or similar specified and the resulting day in the week, month or year might fall on a summer-time start date.There are test cases and code fixes for all that.
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.
Got it, thanks for the details
Indeed that appears like a separate question that is out of scope
Looks good to me overall, with all the tests it's convincing that it behaves correctly