1.1 --- a/EventAggregatorSupport.py Wed Jul 20 00:53:40 2011 +0200
1.2 +++ b/EventAggregatorSupport.py Sat Jul 23 15:59:27 2011 +0200
1.3 @@ -905,7 +905,14 @@
1.4 # Permit omission of the end of the event by duplicating the start.
1.5
1.6 if self.details.has_key("start") and not self.details.has_key("end"):
1.7 - self.details["end"] = self.details["start"]
1.8 + end = self.details["start"]
1.9 +
1.10 + # Make any end time refer to the day instead.
1.11 +
1.12 + if isinstance(end, DateTime):
1.13 + end = end.as_date()
1.14 +
1.15 + self.details["end"] = end
1.16
1.17 def __repr__(self):
1.18 return "<Event %r %r>" % (self.getSummary(), self.as_limits())
1.19 @@ -1016,10 +1023,14 @@
1.20
1.21 # Use dates for the calendar limits.
1.22
1.23 - if isinstance(calendar_start, Month):
1.24 + if isinstance(calendar_start, Date):
1.25 + pass
1.26 + elif isinstance(calendar_start, Month):
1.27 calendar_start = calendar_start.as_date(1)
1.28
1.29 - if isinstance(calendar_end, Month):
1.30 + if isinstance(calendar_end, Date):
1.31 + pass
1.32 + elif isinstance(calendar_end, Month):
1.33 calendar_end = calendar_end.as_date(-1)
1.34
1.35 resources = []
1.36 @@ -1303,7 +1314,7 @@
1.37 if isinstance(start, DateTime):
1.38 times.add(start)
1.39 else:
1.40 - times.add(start.as_datetime(None, None, None, None))
1.41 + times.add(start.as_start_of_day())
1.42
1.43 if isinstance(end, DateTime):
1.44 times.add(end)
1.45 @@ -1528,6 +1539,9 @@
1.46 def as_datetime(self, hour, minute, second, zone):
1.47 return DateTime(self.as_tuple() + (hour, minute, second, zone))
1.48
1.49 + def as_start_of_day(self):
1.50 + return self.as_datetime(None, None, None, None)
1.51 +
1.52 def as_date(self):
1.53 return self
1.54