Actions
Defect #5329
closedTime entries report broken on first week of year
Defect #5329:
Time entries report broken on first week of year
Resolution:
Fixed
Affected version:
Description
Redmine stores some additional columns time entries:
- tmonth ->
date.month - tyear ->
date.year - tweek ->
date.cweek
These are used to support group by of the time entries in the reports view. However, there is an edge case which breaks the code.
Consider the following 2 time entry:
| field | Time Entry 1 | Time Entry 2 |
|---|---|---|
| spent_on | 2009-12-12 | 2010-01-01 |
| tmonth | 12 | 01 |
| tyear | 2009 | 2010 |
| tweek | 53 | 53 |
Both are in the same week, but in different years. This leads to the second entry to be not displayed often, and if then in the wrong week, i.e. 2010-53. For the group-by week, instead of date.year, date.cwyear should be used. It results in 2009 for the second example entry.
The attached patch creates a test for that. It also adds the two time entries above as fixtures. Thus, some other tests had to be adapted.
Files
Actions