# HG changeset patch # User Paul Boddie # Date 1438816460 -7200 # Node ID 55c47d34d4d9ed5b496c529fe82d36421677d971 # Parent 67f632c95747d025173c740c2a4001329c31560f Convert start and end points of free/busy periods to UTC immediately, fixing incorrect conversion of zone-specific dates where the user's time zone is inappropriately used instead of the specified time zone, occurring because the specified time zone does not accompany any date object when initialising the period (being indicated by separate attributes that are not provided) and thus the user's time zone is then used as a fallback. diff -r 67f632c95747 -r 55c47d34d4d9 imiptools/period.py --- a/imiptools/period.py Wed Aug 05 01:04:37 2015 +0200 +++ b/imiptools/period.py Thu Aug 06 01:14:20 2015 +0200 @@ -144,7 +144,7 @@ def __init__(self, start, end, uid=None, transp=None, recurrenceid=None, summary=None, organiser=None, tzid=None): """ - Initialise a free/busy period with the given 'start' and 'end' limits, + Initialise a free/busy period with the given 'start' and 'end' points, with an optional 'tzid', plus any 'uid', 'transp', 'recurrenceid', 'summary' and 'organiser' details. """ @@ -193,6 +193,12 @@ def __repr__(self): return "FreeBusyPeriod%r" % (self.as_tuple(),) + def get_start_point(self): + return self.start + + def get_end_point(self): + return self.end + class RecurringPeriod(Period): """ @@ -664,6 +670,6 @@ remove_period(freebusy, uid, recurrenceid) for p in periods: - insert_period(freebusy, FreeBusyPeriod(p.get_start(), p.get_end(), uid, transp, recurrenceid, summary, organiser, p.tzid)) + insert_period(freebusy, FreeBusyPeriod(p.get_start_point(), p.get_end_point(), uid, transp, recurrenceid, summary, organiser, p.tzid)) # vim: tabstop=4 expandtab shiftwidth=4 diff -r 67f632c95747 -r 55c47d34d4d9 imipweb/resource.py --- a/imipweb/resource.py Wed Aug 05 01:04:37 2015 +0200 +++ b/imipweb/resource.py Thu Aug 06 01:14:20 2015 +0200 @@ -146,8 +146,8 @@ summary.append( FreeBusyPeriod( - p.get_start(), - p.get_end(), + p.get_start_point(), + p.get_end_point(), uid, obj.get_value("TRANSP"), recurrenceid,