aboutsummaryrefslogtreecommitdiffstats
path: root/app/models
diff options
context:
space:
mode:
Diffstat (limited to 'app/models')
-rw-r--r--app/models/holiday.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/app/models/holiday.rb b/app/models/holiday.rb
index 237fe5757..f07e3b05e 100644
--- a/app/models/holiday.rb
+++ b/app/models/holiday.rb
@@ -59,4 +59,13 @@ class Holiday < ActiveRecord::Base
response_required_by
end
+ # Calculate the date on which a request made on a given date falls due when
+ # the days are given in calendar days (rather than working days)
+ def Holiday.due_date_from_calendar_days(start_date, days)
+ response_required_by = start_date + days
+ while weekend_or_holiday?(response_required_by)
+ response_required_by += 1
+ end
+ response_required_by
+ end
end