timelog_controller.rb.diff

Yuki Kita, 2010-03-30 15:10

Download (1.34 KB)

View differences:

app/controllers/timelog_controller.rb (working copy)
278 278
        @from = Date.today - 7 - (Date.today.cwday - 1)%7
279 279
        @to = @from + 6
280 280
      when '7_days'
281
        @from = Date.today - 7
281
        @from = Date.today - 6
282 282
        @to = Date.today
283 283
      when 'current_month'
284 284
        @from = Date.civil(Date.today.year, Date.today.month, 1)
......
287 287
        @from = Date.civil(Date.today.year, Date.today.month, 1) << 1
288 288
        @to = (@from >> 1) - 1
289 289
      when '30_days'
290
        @from = Date.today - 30
290
        @from = Date.today - 29
291 291
        @to = Date.today
292 292
      when 'current_year'
293 293
        @from = Date.civil(Date.today.year, 1, 1)
test/functional/timelog_controller_test.rb (working copy)
342 342
    assert_template 'details'
343 343
    assert_not_nil assigns(:entries)
344 344
    assert_not_nil assigns(:total_hours)
345
    assert_equal Date.today - 7, assigns(:from)
345
    assert_equal Date.today - 6, assigns(:from)
346 346
    assert_equal Date.today, assigns(:to)
347 347
  end
348 348