icalevents
icalevents copied to clipboard
Using dateutil.rrule
Is there a reason not to use dateutil.rrule
for handling recurring events? It claims to implement a superset of iCal rrules, handles exdates, exrules ~~and DST transitions~~ (apparently, it doesn't). If there is no reason against it, I would propose to rewrite the whole recurring events logic.
What the new code does:
- Extract the calendar's first TZID. If any is present, it is used (instead of UTC) for datetime normalization.
- Use
dateutil.rrule
for recursion rule parsing and expansion, handling DST transitions according to the calendars TZID (or UTC). - Observe EXDATEs via
rruleset
objects.
What is yet to be implemented:
- Observe RDATEs and EXRULEs.
- Use an event's specified timezone (if any, instead of the calendar's timezone) for rrule expansion.
I would be willing to work on those two points. But for 1, real world use cases would be helpful. And for 2, I would like to get some thoughts on how event specific timezones should interact with datetime normalization by the icalparser.normalize
function. Probably #19 should also be considered here.
rrule is now used - thanks for the issue :-)