1.1 --- a/imip_manager.py Sun Feb 08 20:06:37 2015 +0100
1.2 +++ b/imip_manager.py Sun Feb 08 20:07:47 2015 +0100
1.3 @@ -692,7 +692,7 @@
1.4 else:
1.5 dtstart, dtstart_attr = obj.get_datetime_item("DTSTART")
1.6
1.7 - dtend, dtend_attr = None, None
1.8 + dtend, dtend_attr = None, {}
1.9
1.10 if args.get("dtend-control", [None])[0] == "enable":
1.11 t = self.handle_date_controls("dtend")
1.12 @@ -707,7 +707,7 @@
1.13 if dtend and not isinstance(dtend, datetime):
1.14 dtend -= timedelta(1)
1.15
1.16 - if isinstance(dtend, datetime) or dtstart != dtend:
1.17 + if dtend and (isinstance(dtend, datetime) or dtstart != dtend):
1.18 page.input(name="dtend-control", type="radio", value="enable", id="dtend-enable", checked="checked")
1.19 page.input(name="dtend-control", type="radio", value="disable", id="dtend-disable")
1.20 else:
1.21 @@ -738,8 +738,8 @@
1.22 if name == "DTSTART":
1.23 dt, attr, event_tzid = dtstart, dtstart_attr, dtstart_attr.get("TZID", tzid)
1.24 else:
1.25 - dt, attr, event_tzid = dtend, dtend_attr, dtend_attr.get("TZID", tzid)
1.26 -
1.27 + dt, attr, event_tzid = dtend or dtstart, dtend_attr or dtstart_attr, (dtend_attr or dtstart_attr).get("TZID", tzid)
1.28 +
1.29 strvalue = self.format_datetime(dt, "full")
1.30 value = format_datetime(dt)
1.31