Defect #3112

Bug in spent time report - the start date isn't included

Added by Anonymous over 8 years ago. Updated almost 8 years ago.

Status:ClosedStart date:2009-04-03
Priority:NormalDue date:
Assignee:-% Done:

100%

Category:Time tracking
Target version:0.8.7
Resolution:Fixed Affected version:0.8.2

Description

I've just been checking spent time reports for this week. I've logged time on both 2009-04-01 and 2009-04-02 but if I ask for a report from these days, the report displays the column for 2009-04-01 but doesn't display any values in it. If I change the start date to 2009-03-31 then suddenly the values appear. See the attached images which show this. In image 1, no values are listed under 2009-04-01 but in the second image the correct values are listed.

Redmine-0.8.2
sqlite-3.5.9
ruby-1.8.6 on win32
rails-2.1.2

Image1.PNG (17.8 KB) Anonymous, 2009-04-03 09:23

Image2.PNG (29.1 KB) Anonymous, 2009-04-03 09:23

before.PNG - Missing values for the 4th May (46.4 KB) Brad Rushworth, 2009-05-11 02:30

after.PNG - Values appear for the 4th May (46.4 KB) Brad Rushworth, 2009-05-11 02:30

Associated revisions

Revision 3009
Added by Jean-Philippe Lang almost 8 years ago

Fixed: first day of date range is not included in time report with SQLite (#3112).

History

#1 Updated by Brad Rushworth over 8 years ago

I'm experiencing the same problem on Redmine 0.8.2.stable (SQLite).

Using the "last 7 days" drop down option has the same behaviour.

I assume this has something to do with converting the date "2009-05-04" into the correct datetime "2009-05-04 00:00:00".

In fact, this bug is better shown by selecting "today" or setting the 'from' and 'to' fields to the same day. No data is shown. However, move the 'from' date back a day and you get todays data but not yesterdays.

I narrowed it down to here:
source:tags/0.8.2/app/controllers/timelog_controller.rb
Lines 91 and 158 show:
['spent_on BETWEEN ? AND ?', @from, @to]

Clearly this isn't going to show all data from today, if @from and @to are the same value.

Perhaps we could add a line near L285 saying:
@from = @from - 1

My knowledge of Ruby programming is quite limited, so I welcome any suggestions.

#2 Updated by Anonymous about 8 years ago

  • Category set to Time tracking

Is there any chance this could be fixed at some point? We have to tie up time reports from Redmine with our companie's time-tracking system. Having to remember to subtract '1' from the from date isn't always done which makes the tying up inaccurate.

Thanks

Russell

#3 Updated by Hans Kazan almost 8 years ago

Russell Hind wrote:

Is there any chance this could be fixed at some point?

Does anyone have a suggestion or patch to help us out with this issue?

Thanks advance!

#4 Updated by Jean-Philippe Lang almost 8 years ago

  • Status changed from New to Resolved
  • Target version set to 0.8.7
  • Resolution set to Fixed

Fixed in r3009. This bug was specific to SQLite.

#5 Updated by Hans Kazan almost 8 years ago

Jean-Philippe Lang wrote:

Fixed in r3009. This bug was specific to SQLite.

Thanks for solving and notifying us!

#6 Updated by Anonymous almost 8 years ago

Yes thanks for fixing this, it will help greatly.

#7 Updated by Eric Davis almost 8 years ago

  • Status changed from Resolved to Closed
  • % Done changed from 0 to 100

Merged into 0.8-stable in r3046.

Also available in: Atom PDF