redmine-2.1-last_2_weeks.diff

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

Download (1.6 KB)

View differences:

app/helpers/timelog_helper.rb (working copy)
77 77
                        [l(:label_yesterday), 'yesterday'],
78 78
                        [l(:label_this_week), 'current_week'],
79 79
                        [l(:label_last_week), 'last_week'],
80
						[l(:label_last_n_weeks, 2), 'last_2_weeks'],
80 81
                        [l(:label_last_n_days, 7), '7_days'],
81 82
                        [l(:label_this_month), 'current_month'],
82 83
                        [l(:label_last_month), 'last_month'],
app/controllers/timelog_controller.rb (working copy)
308 308
      when 'last_week'
309 309
        @from = Date.today - 7 - (Date.today.cwday - 1)%7
310 310
        @to = @from + 6
311
	  when 'last_2_weeks'
312
	    @from = Date.today - 14 - (Date.today.cwday - 1)%7
313
        @to = @from + 13
311 314
      when '7_days'
312 315
        @from = Date.today - 7
313 316
        @to = Date.today
config/locales/en.yml (working copy)
659 659
  label_yesterday: yesterday
660 660
  label_this_week: this week
661 661
  label_last_week: last week
662
  label_last_n_weeks: "last %{count} weeks"
662 663
  label_last_n_days: "last %{count} days"
663 664
  label_this_month: this month
664 665
  label_last_month: last month