Commits

Luke Plant committed a29f678

Fixed bugs with 'this sunday' view.

Comments (0)

Files changed (1)

christchurch/views.py

         self.vevent = vevent # for debugging
 
     def nice_time(self):
-        if self.start.hour < 11:
+        if not hasattr(self.start, 'time'):
+            return ''
+        if self.start.time().hour < 11:
             return "Morning"
-        elif self.start.hour >= 17:
+        elif self.start.time().hour >= 17:
             return "Evening"
         else:
             return "Afternoon"
             # not part way through, so truncate hour to zero
             today = datetime.now(local_timezone).replace(hour=0)
             if d > today and d < today + timedelta(7):
-                events.append(Event(d, vevent.summary.value))
+                events.append(Event(vevent.summary.value, d))
         events.sort()
         c['events'] = events
     else: