1.1 --- a/imip_manager.py Tue Mar 24 01:11:02 2015 +0100
1.2 +++ b/imip_manager.py Tue Mar 24 17:55:30 2015 +0100
1.3 @@ -1010,12 +1010,6 @@
1.4 elif dtend_control == "disable":
1.5 dtend, dtend_attr = None, {}
1.6
1.7 - # Change end dates to refer to the actual dates, not the iCalendar
1.8 - # "next day" dates.
1.9 -
1.10 - if dtend and not isinstance(dtend, datetime):
1.11 - dtend -= timedelta(1)
1.12 -
1.13 return (dtstart, dtstart_attr), (dtend, dtend_attr)
1.14
1.15 # Page fragment methods.
1.16 @@ -1288,7 +1282,7 @@
1.17 dtend_control = args.get(ssn("dtend-control", "recur", index), [None])[0]
1.18 dttimes_control = args.get(ssn("dttimes-control", "recur", index), [None])[0]
1.19
1.20 - dtend_enabled = dtend_control == "enable" or isinstance(end, datetime) or start != end
1.21 + dtend_enabled = dtend_control == "enable" or isinstance(end, datetime) or start != end - timedelta(1)
1.22 dttimes_enabled = dttimes_control == "enable" or isinstance(start, datetime) or isinstance(end, datetime)
1.23
1.24 if dtend_enabled:
1.25 @@ -1313,6 +1307,12 @@
1.26 page = self.page
1.27 is_organiser = get_uri(obj.get_value("ORGANIZER")) == self.user
1.28
1.29 + # Change end dates to refer to the actual dates, not the iCalendar
1.30 + # "next day" dates.
1.31 +
1.32 + if not show_start and not isinstance(dt, datetime):
1.33 + dt -= timedelta(1)
1.34 +
1.35 # Show controls for editing as organiser.
1.36
1.37 if is_organiser:
1.38 @@ -1362,6 +1362,12 @@
1.39
1.40 is_organiser = get_uri(obj.get_value("ORGANIZER")) == self.user
1.41
1.42 + # Change end dates to refer to the actual dates, not the iCalendar
1.43 + # "next day" dates.
1.44 +
1.45 + if not isinstance(end, datetime):
1.46 + end -= timedelta(1)
1.47 +
1.48 start_utc = format_datetime(to_timezone(start, "UTC"))
1.49 replaced = recurrenceids and start_utc in recurrenceids and "replaced" or ""
1.50 css = " ".join([