Issue/1436/exdate with date values - #1482
Conversation
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.
|
Please rebase on top of current master (this should fix most of CI failures). |
|
It's already rebased on top of current master. There was a CI failure due to |
WhyNotHugo
left a comment
There was a problem hiding this comment.
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.
| 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): |
There was a problem hiding this comment.
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.
Fix #1436