diff options
author | Matthew Landauer <matthew@openaustralia.org> | 2012-09-24 18:49:14 +1000 |
---|---|---|
committer | Matthew Landauer <matthew@openaustralia.org> | 2012-09-24 18:49:14 +1000 |
commit | 4cd4eacd7f43536f2b0f4bc9b8eb0fc2445031c5 (patch) | |
tree | d82df71249f7925c5ce9308b133cefd8f0eabead /app/controllers/holiday_controller.rb | |
parent | 9d28b41b96cf3ecead26c72bd64ff069f8bd519f (diff) |
Make the way number of days are calculated (either by calendar or working days) configurable
Diffstat (limited to 'app/controllers/holiday_controller.rb')
-rw-r--r-- | app/controllers/holiday_controller.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/app/controllers/holiday_controller.rb b/app/controllers/holiday_controller.rb index 3a37b8d32..9430c0756 100644 --- a/app/controllers/holiday_controller.rb +++ b/app/controllers/holiday_controller.rb @@ -15,7 +15,8 @@ class HolidayController < ApplicationController if params[:holiday] @request_date = Date.strptime(params[:holiday]) or raise "Invalid date" days_later = MySociety::Config.get('REPLY_LATE_AFTER_DAYS', 20) - @due_date = Holiday.due_date_from_working_days(@request_date, days_later) + working_or_calendar_days = MySociety::Config.get('WORKING_OR_CALENDAR_DAYS', 'working') + @due_date = Holiday.due_date_from(@request_date, days_later, working_or_calendar_days) @skipped = Holiday.all( :conditions => [ 'day >= ? AND day <= ?', @request_date.strftime("%F"), @due_date.strftime("%F") |