[calendar view] fix related to the date_range mess (max value exclusion). Calendar views authors should check if more similar fixes needed stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Mon, 15 Feb 2010 15:20:06 +0100
branchstable
changeset 4582 d12b81facd1d
parent 4581 c92ded4dee20
child 4583 356f08325072
[calendar view] fix related to the date_range mess (max value exclusion). Calendar views authors should check if more similar fixes needed
web/views/calendar.py
--- a/web/views/calendar.py	Mon Feb 15 15:18:38 2010 +0100
+++ b/web/views/calendar.py	Mon Feb 15 15:20:06 2010 +0100
@@ -155,7 +155,9 @@
             last_day_of_month = date(year + 1, 1, 1) - timedelta(1)
         else:
             last_day_of_month = date(year, month + 1, 1) - timedelta(1)
-        lastday = last_day_of_month + timedelta(6 - last_day_of_month.weekday())
+        # date range exclude last day so we should at least add one day, hence
+        # the 7
+        lastday = last_day_of_month + timedelta(7 - last_day_of_month.weekday())
         month_dates = list(date_range(firstday, lastday))
         dates = {}
         task_max = 0
@@ -250,7 +252,6 @@
         # output header
         self.w(u'<tr><th>%s</th><th>%s</th><th>%s</th><th>%s</th><th>%s</th><th>%s</th><th>%s</th></tr>' %
                tuple(self._cw._(day) for day in WEEKDAYS))
-
         # build calendar
         for mdate, task_rows in zip(month_dates, days):
             if mdate.weekday() == 0: