Skip to content
Snippets Groups Projects
Commit a6408d81 authored by Tyler Lemburg's avatar Tyler Lemburg
Browse files

Recurs until date is max 1 year in the future

parent eb174670
No related branches found
No related tags found
No related merge requests found
...@@ -220,7 +220,16 @@ post '/:service_space_url_name/resources/:resource_id/reserve/?' do ...@@ -220,7 +220,16 @@ post '/:service_space_url_name/resources/:resource_id/reserve/?' do
end end
if params.checked?('recurring') if params.checked?('recurring')
recurs_until_date = Time.strptime(params[:recurs_until_date], '%m/%d/%Y').midnight.in_time_zone begin
recurs_until_date = Time.strptime(params[:recurs_until_date], '%m/%d/%Y').midnight.in_time_zone
rescue
recurs_until_date = nil
end
if recurs_until_date.nil? || recurs_until_date - 365.days > Time.now || recurs_until_date < start_time.midnight.in_time_zone
flash :error, 'Invalid Recurs Until Date', 'Your recurs-until date must be less than a year in the future.'
redirect back
end
# use the recurring type to increment the date here # use the recurring type to increment the date here
starts = [] starts = []
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment