From 3a178a42cfc05933dc876f875ff9aa45ffc794b5 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Tue, 9 Oct 2012 17:40:00 +0000 Subject: Add "last 2 weeks" preset to time entries reporting (#11862). git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10583 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/controllers/timelog_controller.rb | 3 +++ app/helpers/timelog_helper.rb | 1 + 2 files changed, 4 insertions(+) (limited to 'app') diff --git a/app/controllers/timelog_controller.rb b/app/controllers/timelog_controller.rb index 7aae12b5c..1756758c6 100644 --- a/app/controllers/timelog_controller.rb +++ b/app/controllers/timelog_controller.rb @@ -308,6 +308,9 @@ private when 'last_week' @from = Date.today - 7 - (Date.today.cwday - 1)%7 @to = @from + 6 + when 'last_2_weeks' + @from = Date.today - 14 - (Date.today.cwday - 1)%7 + @to = @from + 13 when '7_days' @from = Date.today - 7 @to = Date.today diff --git a/app/helpers/timelog_helper.rb b/app/helpers/timelog_helper.rb index 5642266b1..11a447660 100644 --- a/app/helpers/timelog_helper.rb +++ b/app/helpers/timelog_helper.rb @@ -77,6 +77,7 @@ module TimelogHelper [l(:label_yesterday), 'yesterday'], [l(:label_this_week), 'current_week'], [l(:label_last_week), 'last_week'], + [l(:label_last_n_weeks, 2), 'last_2_weeks'], [l(:label_last_n_days, 7), '7_days'], [l(:label_this_month), 'current_month'], [l(:label_last_month), 'last_month'], -- cgit v1.2.3