Project

General

Profile

Patch #11862 ยป redmine-2.1-last_2_weeks.diff

Add "last 2 weeks" date preset to 2.1 stable - Murray Melvin, 2012-09-17 21:22

View differences:

app/helpers/timelog_helper.rb (working copy)
[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'],
app/controllers/timelog_controller.rb (working copy)
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
config/locales/en.yml (working copy)
label_yesterday: yesterday
label_this_week: this week
label_last_week: last week
label_last_n_weeks: "last %{count} weeks"
label_last_n_days: "last %{count} days"
label_this_month: this month
label_last_month: last month
    (1-1/1)