Skip to content

fix(event): use the event time zone for all-day EXDATE - #822

Merged
sebbo2002 merged 1 commit into
sebbo2002:developfrom
bardrop-oss:fix-allday-exdate-event-timezone
Nov 26, 2026
Merged

sebbo2002 merged 1 commit into
sebbo2002:developfrom
bardrop-oss:fix-allday-exdate-event-timezone

Conversation

@bardrop

@bardrop bardrop commented Nov 26, 2026

Copy link
Copy Markdown
Contributor

About this Pull Request

  • What kind of change does this PR introduce?
    • Bug fix
  • What is the current behavior?
    • For an all-day event, DTSTART, DTEND, UNTIL and RECURRENCE-ID use the event's time zone (this.timezone()), but EXDATE uses the calendar's time zone. When the event has its own time zone, the excluded day can be one day off, so the occurrence is not excluded.

      const d = moment.utc('2026-11-30T15:00:00Z'); // 2026-12-01 00:00 in Tokyo
      ical().createEvent({
          allDay: true,
          start: d,
          timezone: 'Asia/Tokyo',
          repeating: { freq: 'DAILY', count: 3, exclude: [d] },
      });

      Actual:

      DTSTART;VALUE=DATE:20261201
      RRULE:FREQ=DAILY;COUNT=3
      EXDATE;VALUE=DATE:20261130
      

      Expected: EXDATE;VALUE=DATE:20261201, the same day as DTSTART, because the same value is passed for both. With python-dateutil rrulestr(..., forceset=True) the actual output gives 3 occurrences (2026-12-01, 12-02, 12-03), so nothing is excluded. The expected output gives 2 (12-02, 12-03).

      A plain Date shows the same: on a machine in IST, start and exclude = new Date('2026-12-01T00:00:00') with timezone: 'Asia/Tokyo' give DTSTART;VALUE=DATE:20261201 and EXDATE;VALUE=DATE:20261130.

  • What is the new behavior (if this is a feature change)?
  • Does this PR introduce a breaking change?
    • No
  • Other information:
    • New test in test/event.ts fails before the fix (EXDATE;VALUE=DATE:20261130) and passes after.

Pull Request Checklist

  • My code follows the code style of this project
    • Run npm run lint to double check
  • My change requires a change to the documentation
    • I have updated the documentation accordingly
  • I have added tests to cover my changes
    • Run npm run test to run the unit tests and npm run coverage to generate a coverage report
  • All new and existing tests passed
  • My commit messages follow the commit guidelines

DTSTART, DTEND, UNTIL and RECURRENCE-ID of an all-day event use the
event's time zone, but EXDATE used the calendar's one. When the event
has its own time zone, the excluded date could be one day off, so the
occurrence was not excluded.
@sebbo2002
sebbo2002 merged commit 0b9eef4 into sebbo2002:develop Nov 26, 2026
9 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 11.1.5-develop.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants