# HG changeset patch # User Paul Boddie # Date 1427216130 -3600 # Node ID 63025c6fa6e82625d92ccb92ea5f949f0ce37163 # Parent d6466d09eb7e0400897861d8405ecb704e1cd4ba Moved iCalendar date value correction and modified same-day testing. diff -r d6466d09eb7e -r 63025c6fa6e8 imip_manager.py --- a/imip_manager.py Tue Mar 24 01:11:02 2015 +0100 +++ b/imip_manager.py Tue Mar 24 17:55:30 2015 +0100 @@ -1010,12 +1010,6 @@ elif dtend_control == "disable": dtend, dtend_attr = None, {} - # Change end dates to refer to the actual dates, not the iCalendar - # "next day" dates. - - if dtend and not isinstance(dtend, datetime): - dtend -= timedelta(1) - return (dtstart, dtstart_attr), (dtend, dtend_attr) # Page fragment methods. @@ -1288,7 +1282,7 @@ dtend_control = args.get(ssn("dtend-control", "recur", index), [None])[0] dttimes_control = args.get(ssn("dttimes-control", "recur", index), [None])[0] - dtend_enabled = dtend_control == "enable" or isinstance(end, datetime) or start != end + dtend_enabled = dtend_control == "enable" or isinstance(end, datetime) or start != end - timedelta(1) dttimes_enabled = dttimes_control == "enable" or isinstance(start, datetime) or isinstance(end, datetime) if dtend_enabled: @@ -1313,6 +1307,12 @@ page = self.page is_organiser = get_uri(obj.get_value("ORGANIZER")) == self.user + # Change end dates to refer to the actual dates, not the iCalendar + # "next day" dates. + + if not show_start and not isinstance(dt, datetime): + dt -= timedelta(1) + # Show controls for editing as organiser. if is_organiser: @@ -1362,6 +1362,12 @@ is_organiser = get_uri(obj.get_value("ORGANIZER")) == self.user + # Change end dates to refer to the actual dates, not the iCalendar + # "next day" dates. + + if not isinstance(end, datetime): + end -= timedelta(1) + start_utc = format_datetime(to_timezone(start, "UTC")) replaced = recurrenceids and start_utc in recurrenceids and "replaced" or "" css = " ".join([