Include date links for the whole month, not just from date until end
authorMagnus Hagander <magnus@hagander.net>
Mon, 26 Nov 2012 10:10:07 +0000 (11:10 +0100)
committerMagnus Hagander <magnus@hagander.net>
Mon, 26 Nov 2012 10:10:07 +0000 (11:10 +0100)
django/archives/mailarchives/views.py

index c7d500df9e6925542c3c95ed30feaddeef245842..9ba24d7e1eb7b14cc1838abcd6833dd6bb387763 100644 (file)
@@ -127,7 +127,7 @@ def render_datelist_from(request, l, d, title, to=None):
        if monthdate:
                curs = connection.cursor()
                curs.execute("SELECT DISTINCT extract(day FROM date) FROM messages WHERE date >= %(startdate)s AND date < %(enddate)s AND threadid IN (SELECT threadid FROM list_threads WHERE listid=%(listid)s) ORDER BY 1", {
-                               'startdate': monthdate,
+                               'startdate': datetime(year=monthdate.year, month=monthdate.month, day=1),
                                'enddate': monthdate + timedelta(days=calendar.monthrange(monthdate.year, monthdate.month)[1]),
                                'listid': l.listid,
                                })