Opened 18 years ago

Closed 18 years ago

Last modified 18 years ago

#992 closed defect (fixed)

[patch] archive_month generic view leaves out last day of month

Reported by: James Bennett Owned by: Jacob
Component: Generic views Version: dev
Severity: major Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Items published on the last day of a month won't be listed by the archive_month generic view (for example, at the moment the latest entry in the Django weblog is dated Nov. 30, and doesn't show up in the November archive of the Django blog); the view calculates the first and last day of the month, and uses those in a range lookup, but apparently this isn't inclusive (which is contrary to what the DB API docs claim). The view needs to use the first day of the next month as its last day instead.

Attachments (3)

date_based.diff (829 bytes ) - added by James Bennett 18 years ago.
Patch to use first day of next month instead of last day of month
date_based.2.diff (933 bytes ) - added by James Bennett 18 years ago.
New patch that doesn't hate the month of November
date_based.3.diff (941 bytes ) - added by James Bennett 18 years ago.
It works this time. Testing is our friend.

Download all attachments as: .zip

Change History (6)

by James Bennett, 18 years ago

Attachment: date_based.diff added

Patch to use first day of next month instead of last day of month

by James Bennett, 18 years ago

Attachment: date_based.2.diff added

New patch that doesn't hate the month of November

comment:1 by James Bennett, 18 years ago

Actually... that's two boneheaded blunders in as many attempts. I'm going to grab a few hours of sleep, and then do this right.

by James Bennett, 18 years ago

Attachment: date_based.3.diff added

It works this time. Testing is our friend.

comment:2 by Esaj <jason at jasondavies.com>, 18 years ago

Summary: archive_month generic view leaves out last day of month[patch] archive_month generic view leaves out last day of month

comment:3 by Adrian Holovaty, 18 years ago

Resolution: fixed
Status: newclosed

(In [1571]) Fixed #992 -- Fixed bug in archive_month generic view leaving out the last day of the month. Thanks, ubernostrum

Note: See TracTickets for help on using tickets.
Back to Top