# HG changeset patch # User sylvain.thenault@logilab.fr # Date 1242282919 -7200 # Node ID 183acfaa3cde552f8a0c4a80f1f0afc3974f155f # Parent cc86fe8efaaab07885bd991630c40415f1bbfe5e ensure start/stop are datetime before access to .hour diff -r cc86fe8efaaa -r 183acfaa3cde web/views/calendar.py --- a/web/views/calendar.py Wed May 13 19:51:30 2009 +0200 +++ b/web/views/calendar.py Thu May 14 08:35:19 2009 +0200 @@ -11,7 +11,7 @@ from cubicweb.interfaces import ICalendarable from cubicweb.selectors import implements -from cubicweb.utils import strptime, date_range, todate +from cubicweb.utils import strptime, date_range, todate, todatetime from cubicweb.view import EntityView from cubicweb.web import ajax_replace_url @@ -116,7 +116,7 @@ def in_working_hours(self): """predicate returning True is the task is in working hours""" - if self.task.start.hour > 7 and self.task.stop.hour < 20: + if todatetime(self.task.start).hour > 7 and todatetime(self.task.stop).hour < 20: return True return False