Modify ↓
Opened 16 years ago
Closed 16 years ago
#4263 closed defect (fixed)
tracmetrix pdashboard does not create backlog statistics for december (month=12)
Reported by: | anonymous | Owned by: | Bhuricha Deen Sethanandha |
---|---|---|---|
Priority: | high | Component: | TracMetrixPlugin |
Severity: | major | Keywords: | |
Cc: | Trac Release: | 0.11 |
Description (last modified by )
in web_ui.py:
def last_day_of_month(year, month):
return datetime(year, (month%12)+1, 1, tzinfo=utc) - timedelta(days=1)
contains a bug because it will produce:
2007-12-31 00:00:00+00:00
and not
2008-12-31 00:00:00+00:00
for december 2008.
it computes one day before january 1st of the current year (not the next).
this can be fixed by changing the return line to:
return datetime(year+(month/12), (month%12)+1 , 1, tzinfo=utc) - timedelta(days=1)
and thereby adding 1 to the year in case the month is december.
Attachments (0)
Change History (2)
comment:1 Changed 16 years ago by
Description: | modified (diff) |
---|---|
Status: | new → assigned |
comment:2 Changed 16 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Note: See
TracTickets for help on using
tickets.
Fixed in [5420]