# HG changeset patch # User Paul Boddie # Date 1311429567 -7200 # Node ID 23288a853ef1a4b282c81cc7773612e1f4a1e1bd # Parent 18da3bd40274a58add990b4af772d0d32b572d5f Fixed URL construction for remote events where the query involves dates. Changed the duplication of the start of an event where no end is specified to provide an end date if a start time is given. This should cause the end of the event to be interpreted as the end of the day and thus the duration as the remainder of the day. Added an as_start_of_day method to the Date class. Added notes about points in time, external event interpretation and map projections. diff -r 18da3bd40274 -r 23288a853ef1 EventAggregatorSupport.py --- a/EventAggregatorSupport.py Wed Jul 20 00:53:40 2011 +0200 +++ b/EventAggregatorSupport.py Sat Jul 23 15:59:27 2011 +0200 @@ -905,7 +905,14 @@ # Permit omission of the end of the event by duplicating the start. if self.details.has_key("start") and not self.details.has_key("end"): - self.details["end"] = self.details["start"] + end = self.details["start"] + + # Make any end time refer to the day instead. + + if isinstance(end, DateTime): + end = end.as_date() + + self.details["end"] = end def __repr__(self): return "" % (self.getSummary(), self.as_limits()) @@ -1016,10 +1023,14 @@ # Use dates for the calendar limits. - if isinstance(calendar_start, Month): + if isinstance(calendar_start, Date): + pass + elif isinstance(calendar_start, Month): calendar_start = calendar_start.as_date(1) - if isinstance(calendar_end, Month): + if isinstance(calendar_end, Date): + pass + elif isinstance(calendar_end, Month): calendar_end = calendar_end.as_date(-1) resources = [] @@ -1303,7 +1314,7 @@ if isinstance(start, DateTime): times.add(start) else: - times.add(start.as_datetime(None, None, None, None)) + times.add(start.as_start_of_day()) if isinstance(end, DateTime): times.add(end) @@ -1528,6 +1539,9 @@ def as_datetime(self, hour, minute, second, zone): return DateTime(self.as_tuple() + (hour, minute, second, zone)) + def as_start_of_day(self): + return self.as_datetime(None, None, None, None) + def as_date(self): return self diff -r 18da3bd40274 -r 23288a853ef1 TO_DO.txt --- a/TO_DO.txt Wed Jul 20 00:53:40 2011 +0200 +++ b/TO_DO.txt Sat Jul 23 15:59:27 2011 +0200 @@ -1,11 +1,25 @@ +Points in Time +-------------- + +Events which have identical start and end times might be represented by +building a calendar scale that distinguishes between times acting as start +times and times acting as end times. + +Consider making dates convertible to timespans of the form (start of day, +start of next day). + GriCal and External Aggregation ------------------------------- +Make URL parameterisation robust enough to prevent arbitrary URL fragment +insertion. + Support a linkToEvent method on Event instances, possibly just delegating to linkToPage for Wiki events (although event sections could provide anchors for -events in Wiki pages). +events in Wiki pages). Calendar events would provide their own URL property. -Support caching and proper encoding detection. +Support caching and proper encoding detection. Response metadata could be +inspected, defaulting to UTF-8 if necessary. Support navigation where the full extent of external events cannot be detected. @@ -42,6 +56,12 @@ Map Views --------- +Explicit latitude and longitude values (such as the iCalendar GEO property) +could be supported. + +Other projections might be supported. This would be necessary for various +retrieved map images. + Dynamic images obtained from other sites or generated locally might provide some enhancements to the map view. For example, a weather/radar image might show the cloud or rain forecast either for the current situation or, if forecasts are