Repository navigation
fix(ical): honor elapsed duration across daylight saving changes - #566
Merged
Merged
Conversation
KnifeLemon
approved these changes
Oct 25, 2026
KnifeLemon
left a comment
Owner
There was a problem hiding this comment.
Thanks @Stamina9! Splitting the duration into calendar days added on the local clock and hours, minutes and seconds added as elapsed time is exactly what RFC 5545 asks for, and the tests cover the cases that matter (P1D vs PT24H, mixed P1DT2H, both transitions, an embedded VTIMEZONE). Since you couldn't run .NET, I ran it here: the iCalendar tests pass, the new test fails without the fix, and dotnet format is clean. It can be merged once CI is green.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What does this change?
When an iCalendar event has
DTSTARTplusDURATION, Filee now adds calendar days to the local date first, then adds hours/minutes/seconds as elapsed time. This preserves the distinction betweenP1DandPT24Hacross a daylight saving change, as required by RFC 5545, section 3.3.6.For example,
DTSTART;TZID=America/New_York:20260308T013000withDURATION:PT2Hends at2026-03-08T04:30:00-04:00. The previous local-clock addition produced03:30.Type of change
How was it tested?
dotnet format --verify-no-changes— pending: .NET SDK unavailable in the preparation environmentdotnet test— pending: .NET SDK unavailable in the preparation environmentP1DversusPT24H, a mixed duration, and an embeddedVTIMEZONEgit apply --check --whitespace=errorScreenshots (UI changes)
No UI changes.
Checklist