# HG changeset patch # User sylvain.thenault@logilab.fr # Date 1241105743 -7200 # Node ID 76680e5153346aa493bce58d6d649f187f1ec9a1 # Parent e4845b54a704a94c204d12ddc506fb3223cddd34 use last_day diff -r e4845b54a704 -r 76680e515334 goa/skel/views.py --- a/goa/skel/views.py Thu Apr 30 17:35:11 2009 +0200 +++ b/goa/skel/views.py Thu Apr 30 17:35:43 2009 +0200 @@ -1,7 +1,7 @@ # custom application views -from calendar import monthrange from datetime import date +from cubicweb.utils import last_day from cubicweb.web.views import baseviews, boxes, calendar from cubicweb.web.htmlwidgets import BoxLink, BoxWidget @@ -36,7 +36,7 @@ box = BoxWidget(_('Blog archives'), id=self.id) for year, month in blogmonths: firstday = date(year, month, 1) - lastday = date(year, month, monthrange(year, month)[1]) + lastday = last_day(firstday) rql = ('Any B WHERE B is BlogEntry, B creation_date >= "%s", B creation_date <= "%s"' % (firstday.strftime('%Y-%m-%d'), lastday.strftime('%Y-%m-%d'))) url = self.build_url(rql=rql)