Skip to content

Issue/1436/exdate with date values - #1482

Open
demaledetti wants to merge 8 commits into
pimutils:masterfrom
demaledetti:issue/1436/exdate-with-date-values
Open

Issue/1436/exdate with date values#1482
demaledetti wants to merge 8 commits into
pimutils:masterfrom
demaledetti:issue/1436/exdate-with-date-values

Conversation

@demaledetti

Copy link
Copy Markdown

Fix #1436

Ben Finney and others added 6 commits September 6, 2026 00:03
This is requested in the ‘hacking’ document.
Parser should be able to handle EXDATE with / without timezone, and handle
date or datetime values.
By comparing only the date part, we obey the intent of iCalendar
specification for EXDATE.

Closes: GitHub issue pimutils#1436.
@WhyNotHugo

Copy link
Copy Markdown
Member

Please rebase on top of current master (this should fix most of CI failures).

@demaledetti

Copy link
Copy Markdown
Author

It's already rebased on top of current master. There was a CI failure due to ruff check but I fixed in adb77f8 and I see no other failures now. Please point me to the failures you're referring to and I'll have a look. Thanks!

@WhyNotHugo WhyNotHugo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

A DATE-TIME EXDATE should exclude exactly one instance, while a DATE EXDATE should exclude the whole day.

This change treats both the same; only the date is compared, and a recurring event with multiple instances on a single day (e.g.: every 3 hours) would get all of them excluded.

Disregard my comment above about rebasing; I wrote it without refreshing the page so hadn't seen your previous rebase.

Comment thread khal/icalendar.py
except KeyError:
for exdate in get_dates(vevent, "EXDATE") or ():
exdate_date = exdate.date() if isinstance(exdate, dt.datetime) else exdate
if not any(start_datetime.date() == exdate_date for start_datetime in dtstartl):

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

If start_datetime is an instance of date, then this fails (date.date() doesn't exist).

I think you can repro with:

DTSTART;VALUE=DATE:20140701
RRULE:FREQ=DAILY;COUNT=10
EXDATE:20140703

Ideally, add a test and assert the behaviour.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Expand a recurring event, crashes when EXDATE values are date-only

2 participants