# HG changeset patch # User Paul Boddie # Date 1512340353 -3600 # Node ID 0d89c84c798a39569828b1a105d71206907108e2 # Parent 92389b7220038865566f8ccf08e49a08332bf083 Support date-datetime comparisons when determining the period collection limit. diff -r 92389b722003 -r 0d89c84c798a imiptools/period.py --- a/imiptools/period.py Sun Dec 03 23:01:12 2017 +0100 +++ b/imiptools/period.py Sun Dec 03 23:32:33 2017 +0100 @@ -27,7 +27,7 @@ get_recurrence_start, get_recurrence_start_point, \ get_start_of_day, \ get_tzid, \ - to_timezone, to_utc_datetime + to_datetime, to_timezone, to_utc_datetime from vRecurrence import get_selector def ifnone(x, y): @@ -442,7 +442,10 @@ # Any UNTIL qualifier changes the nature of the end of the collection. if until: - self.end = end and min(until, end) or until + if to_datetime(end, tzid) < to_datetime(until, tzid): + self.end = end + else: + self.end = until self.inclusive = True else: self.end = end