Project

General

Profile

Actions

Defect #5329

closed

Time entries report broken on first week of year

Added by Holger Just over 14 years ago. Updated over 11 years ago.

Status:
Closed
Priority:
Normal
Category:
Time tracking
Target version:
Start date:
2010-04-15
Due date:
% Done:

0%

Estimated time:
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

functional_test_for_problem.patch (4.11 KB) functional_test_for_problem.patch Holger Just, 2010-04-15 19:56
5329_add_year_of_week_to_time_entries.diff (6.91 KB) 5329_add_year_of_week_to_time_entries.diff Holger Just, 2010-06-04 17:06
time_report.rb.patch (863 Bytes) time_report.rb.patch Filou Centrinov, 2013-02-21 23:45
time_report.rb.2.patch (1.04 KB) time_report.rb.2.patch no tabs Filou Centrinov, 2013-02-22 02:23

Related issues

Related to Redmine - Defect #4953: "In the past N days" filter displays N+1 daysConfirmed2010-03-01

Actions
Has duplicate Redmine - Defect #3060: Week numbers dont match in reports and calendar popupsClosed2009-03-27

Actions
Has duplicate Redmine - Defect #2462: Incorrect Week Number in Spent Time ReportClosed2009-01-07

Actions
Has duplicate Redmine - Defect #13082: Wrong year in Spent Time ReportClosed

Actions
Has duplicate Redmine - Defect #13159: Spent Time report - Column Total different for weekClosed

Actions
Has duplicate Redmine - Defect #12891: Wrong week number in time entriesClosed

Actions
Has duplicate Redmine - Defect #12803: Cross-year date range in time tracking report misses some hoursClosed

Actions
Actions

Also available in: Atom PDF