I'm dealing with some ical problems.
I have an ical event.
BEGIN:VEVENT
UID:Event/termine/gps/akt@portal.augusta.de
DTSTART;TZID=CET:20150529T190000
DTEND;TZID=CET:20150529T220000
CATEGORIES:Arbeitsgruppe
DTSTAMP:20110620T075538Z
EXDATE;TZID=CET:20151225T190000
LAST-MODIFIED:20150424T201707Z
LOCATION:Vereinsräume des Augsburger Computer Forum e.V.
PRIORITY:5
RRULE:FREQ=MONTHLY;BYDAY=-1FR
SUMMARY:GPS-Arbeitsgruppe
URL:https://www.augusta.de/termine/gps
END:VEVENT
As you can see there is an RRule repeating this event every last friday of the month.
I parsed this ical with icalendar.
I'm using:
start = iobj.get( 'DTSTART' ).dt
rrset = rruleset()
rrule = iobj.get( 'RRULE' )
exdate = iobj.get( 'EXDATE' )
rrset.rrule( rrule.rrulestr( rule.to_ical(), dtstart = start ) )
for edate in exdate.dts :
rrset.exdate( edate.dt )
Everything so far works just fine.
When I Try to get the next say 10 dates with:
list(rrset)[:10]
I get:
[datetime.datetime(2015, 5, 29, 19, 0, tzinfo=<DstTzInfo 'CET' CEST+2:00:00 DST>),
datetime.datetime(2015, 6, 26, 19, 0, tzinfo=<DstTzInfo 'CET' CEST+2:00:00 DST>),
datetime.datetime(2015, 7, 31, 19, 0, tzinfo=<DstTzInfo 'CET' CEST+2:00:00 DST>),
datetime.datetime(2015, 8, 28, 19, 0, tzinfo=<DstTzInfo 'CET' CEST+2:00:00 DST>),
datetime.datetime(2015, 9, 25, 19, 0, tzinfo=<DstTzInfo 'CET' CEST+2:00:00 DST>),
datetime.datetime(2015, 10, 30, 19, 0, tzinfo=<DstTzInfo 'CET' CEST+2:00:00 DST>),
datetime.datetime(2015, 11, 27, 19, 0, tzinfo=<DstTzInfo 'CET' CEST+2:00:00 DST>),
datetime.datetime(2015, 12, 25, 19, 0, tzinfo=<DstTzInfo 'CET' CEST+2:00:00 DST>),
datetime.datetime(2016, 1, 29, 19, 0, tzinfo=<DstTzInfo 'CET' CEST+2:00:00 DST>),
datetime.datetime(2016, 2, 26, 19, 0, tzinfo=<DstTzInfo 'CET' CEST+2:00:00 DST>)]
Which seems okay on the first glance, but on deeper inspection there is a problem starting with October 30th, daylight saving time ends October 25th but tzinfo info of the datetime object is still "DstTzInfo 'CET' CEST+2:00:00 DST"
The second problem is that the 25th of December is in this list instead of being skipped a specified in the EXDATE. The Problem seams to be tat while parsing the exdate rule daylight saving time is calculated correctly and therefore the exdate 19:00:00+01:00 didn't match the calculated repeat time of 19:00:00+02:00.
Am I doing something wrong there?
Converting everything to UTC and processing there doesn't help because 17:00:00 UTC don't match 18:00:00 UTC either.