Repository navigation
Conversation
getDtEnd() added the duration in seconds with modify(), which uses the clock time. Across a DST transition, the end was wrong. With DTEND, each instance now has the exact duration of the master event. With DURATION, the nominal duration is added to each start, as RFC 5545, section 3.8.5.3, requires. Fixes sabre-io#818.
Add winter time cases for P1D and PT24H, a mixed P1DT2H case, and floating and all-day events with a reference timezone.
jvelo
marked this pull request as ready for review
November 26, 2026 15:00
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.
Summary
Fixes #818.
EventIterator::getDtEnd()added the duration in seconds withmodify(). PHP applies+N secondsto the clock time, so the end of an instance that crosses a DST transition was wrong. The first instance did not match theDTENDof the event.RFC 5545, section 3.8.5.3:
DTEND, all instances have the same exact duration.getDtEnd()now adds the seconds to the timestamp.DURATION, all instances have the same nominal duration.getDtEnd()now adds theDateIntervalto the start of each instance, soP1Dstays one day across a transition. In a mixed duration such asP1DT2H, the days are nominal and the hours are exact.Behaviour changes for floating and all-day events
Floating and all-day events with
DTENDkeep the current behaviour.With
DURATION, the change also applies to floating and all-day events when a reference timezone that observes DST is given to the iterator. For example, withAmerica/New_York:DTSTART:20270306T120000,DURATION:PT24H, weekly: the second instance now ends at 13:00 EDT, before at 12:00 EDT.DTSTART;VALUE=DATE:20270314,DURATION:P1D: the first instance now ends on March 15 at midnight, before on March 14 at 23:00.Both follow RFC 5545.
Tests
DurationAcrossDstTestcovers:DTEND, to summer time and to winter time.DURATIONasP1DandPT24H, to summer time and to winter time.DURATIONasP1DT2H, to summer time.DURATIONand a reference timezone.getEventObject().It checks the instance that crosses the transition and the one after it. 11 of the 12 cases fail without the change. The full suite and phpstan pass.