Skip to content

fix(ical): honor elapsed duration across daylight saving changes - #566

Merged
KnifeLemon merged 1 commit into
KnifeLemon:mainfrom
Stamina9:codex/ical-duration-dst
Oct 25, 2026
Merged

KnifeLemon merged 1 commit into
KnifeLemon:mainfrom
Stamina9:codex/ical-duration-dst

Conversation

@Stamina9

Copy link
Copy Markdown
Contributor

What does this change?

When an iCalendar event has DTSTART plus DURATION, Filee now adds calendar days to the local date first, then adds hours/minutes/seconds as elapsed time. This preserves the distinction between P1D and PT24H across a daylight saving change, as required by RFC 5545, section 3.3.6.

For example, DTSTART;TZID=America/New_York:20260308T013000 with DURATION:PT2H ends at 2026-03-08T04:30:00-04:00. The previous local-clock addition produced 03:30.

Type of change

  • Bug fix
  • New feature or improvement
  • New format or engine
  • Translation
  • Documentation
  • Build, CI or dependencies

How was it tested?

  • dotnet format --verify-no-changes — pending: .NET SDK unavailable in the preparation environment
  • dotnet test — pending: .NET SDK unavailable in the preparation environment
  • Added synthetic iCalendar regression cases for spring and autumn transitions, P1D versus PT24H, a mixed duration, and an embedded VTIMEZONE
  • Checked the patch applies to the upstream main snapshots with git apply --check --whitespace=error

Screenshots (UI changes)

No UI changes.

Checklist

  • No new UI strings
  • No new third-party code or binaries
  • The PR does one thing

@Stamina9
Stamina9 requested a review from KnifeLemon as a code owner October 25, 2026 07:15
@github-actions github-actions Bot added the bug Something isn't working label Oct 25, 2026

@KnifeLemon KnifeLemon left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@KnifeLemon
KnifeLemon merged commit a353ca4 into KnifeLemon:main Oct 25, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants