imip-agent

Changeset

1413:0d89c84c798a
2017-12-03 Paul Boddie raw files shortlog changelog graph Support date-datetime comparisons when determining the period collection limit. client-editing-simplification
imiptools/period.py (file)
     1.1 --- a/imiptools/period.py	Sun Dec 03 23:01:12 2017 +0100
     1.2 +++ b/imiptools/period.py	Sun Dec 03 23:32:33 2017 +0100
     1.3 @@ -27,7 +27,7 @@
     1.4                              get_recurrence_start, get_recurrence_start_point, \
     1.5                              get_start_of_day, \
     1.6                              get_tzid, \
     1.7 -                            to_timezone, to_utc_datetime
     1.8 +                            to_datetime, to_timezone, to_utc_datetime
     1.9  from vRecurrence import get_selector
    1.10  
    1.11  def ifnone(x, y):
    1.12 @@ -442,7 +442,10 @@
    1.13          # Any UNTIL qualifier changes the nature of the end of the collection.
    1.14  
    1.15          if until:
    1.16 -            self.end = end and min(until, end) or until
    1.17 +            if to_datetime(end, tzid) < to_datetime(until, tzid):
    1.18 +                self.end = end
    1.19 +            else:
    1.20 +                self.end = until
    1.21              self.inclusive = True
    1.22          else:
    1.23              self.end = end