# HG changeset patch # User Paul Boddie # Date 1438446272 -7200 # Node ID afeefc78e8eaf233919a84cdaffec72aaf23cac0 # Parent 23f998c9dacd6c185e71b579f9c3ebcfcf212be5 Added missing import plus a comment. diff -r 23f998c9dacd -r afeefc78e8ea imiptools/data.py --- a/imiptools/data.py Sat Aug 01 01:35:03 2015 +0200 +++ b/imiptools/data.py Sat Aug 01 18:24:32 2015 +0200 @@ -25,7 +25,7 @@ from imiptools.dates import format_datetime, get_datetime, \ get_datetime_item as get_item_from_datetime, \ get_datetime_tzid, \ - get_duration, get_period, \ + get_duration, get_period, get_period_item, \ get_recurrence_start_point, \ get_tzid, to_datetime, to_timezone, to_utc_datetime from imiptools.period import Period, RecurringPeriod, period_overlaps @@ -65,6 +65,9 @@ if not self.has_key("RECURRENCE-ID"): return None dt, attr = self.get_datetime_item("RECURRENCE-ID") + + # Coerce any date to a UTC datetime if TZID was specified. + tzid = attr.get("TZID") if tzid: dt = to_timezone(to_datetime(dt, tzid), "UTC")