@@ -308,6 +308,9 private | |||||
308 | when 'last_week' |
|
308 | when 'last_week' | |
309 | @from = Date.today - 7 - (Date.today.cwday - 1)%7 |
|
309 | @from = Date.today - 7 - (Date.today.cwday - 1)%7 | |
310 | @to = @from + 6 |
|
310 | @to = @from + 6 | |
|
311 | when 'last_2_weeks' | |||
|
312 | @from = Date.today - 14 - (Date.today.cwday - 1)%7 | |||
|
313 | @to = @from + 13 | |||
311 | when '7_days' |
|
314 | when '7_days' | |
312 | @from = Date.today - 7 |
|
315 | @from = Date.today - 7 | |
313 | @to = Date.today |
|
316 | @to = Date.today |
@@ -77,6 +77,7 module TimelogHelper | |||||
77 | [l(:label_yesterday), 'yesterday'], |
|
77 | [l(:label_yesterday), 'yesterday'], | |
78 | [l(:label_this_week), 'current_week'], |
|
78 | [l(:label_this_week), 'current_week'], | |
79 | [l(:label_last_week), 'last_week'], |
|
79 | [l(:label_last_week), 'last_week'], | |
|
80 | [l(:label_last_n_weeks, 2), 'last_2_weeks'], | |||
80 | [l(:label_last_n_days, 7), '7_days'], |
|
81 | [l(:label_last_n_days, 7), '7_days'], | |
81 | [l(:label_this_month), 'current_month'], |
|
82 | [l(:label_this_month), 'current_month'], | |
82 | [l(:label_last_month), 'last_month'], |
|
83 | [l(:label_last_month), 'last_month'], |
@@ -663,6 +663,7 en: | |||||
663 | label_yesterday: yesterday |
|
663 | label_yesterday: yesterday | |
664 | label_this_week: this week |
|
664 | label_this_week: this week | |
665 | label_last_week: last week |
|
665 | label_last_week: last week | |
|
666 | label_last_n_weeks: "last %{count} weeks" | |||
666 | label_last_n_days: "last %{count} days" |
|
667 | label_last_n_days: "last %{count} days" | |
667 | label_this_month: this month |
|
668 | label_this_month: this month | |
668 | label_last_month: last month |
|
669 | label_last_month: last month |
@@ -653,6 +653,7 fr: | |||||
653 | label_yesterday: hier |
|
653 | label_yesterday: hier | |
654 | label_this_week: cette semaine |
|
654 | label_this_week: cette semaine | |
655 | label_last_week: la semaine dernière |
|
655 | label_last_week: la semaine dernière | |
|
656 | label_last_n_weeks: "les %{count} dernières semaines" | |||
656 | label_last_n_days: "les %{count} derniers jours" |
|
657 | label_last_n_days: "les %{count} derniers jours" | |
657 | label_this_month: ce mois-ci |
|
658 | label_this_month: ce mois-ci | |
658 | label_last_month: le mois dernier |
|
659 | label_last_month: le mois dernier |
@@ -523,6 +523,13 class TimelogControllerTest < ActionController::TestCase | |||||
523 | assert_equal '2011-12-11'.to_date, assigns(:to) |
|
523 | assert_equal '2011-12-11'.to_date, assigns(:to) | |
524 | end |
|
524 | end | |
525 |
|
525 | |||
|
526 | def test_index_last_2_week | |||
|
527 | Date.stubs(:today).returns('2011-12-15'.to_date) | |||
|
528 | get :index, :period => 'last_2_weeks' | |||
|
529 | assert_equal '2011-11-28'.to_date, assigns(:from) | |||
|
530 | assert_equal '2011-12-11'.to_date, assigns(:to) | |||
|
531 | end | |||
|
532 | ||||
526 | def test_index_7_days |
|
533 | def test_index_7_days | |
527 | Date.stubs(:today).returns('2011-12-15'.to_date) |
|
534 | Date.stubs(:today).returns('2011-12-15'.to_date) | |
528 | get :index, :period => '7_days' |
|
535 | get :index, :period => '7_days' |
General Comments 0
You need to be logged in to leave comments.
Login now