Opened 15 years ago
Last modified 15 years ago
#4263 closed defect
tracmetrix pdashboard does not create backlog statistics for december (month=12) — at Version 1
| 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.
Change History (1)
comment:1 Changed 15 years ago by
| Description: | modified (diff) |
|---|---|
| Status: | new → assigned |
Note: See
TracTickets for help on using
tickets.


