diff --git a/app/controllers/locations_controller.rb b/app/controllers/locations_controller.rb index 32da14ea7..f998ab382 100644 --- a/app/controllers/locations_controller.rb +++ b/app/controllers/locations_controller.rb @@ -141,7 +141,7 @@ class LocationsController < ApplicationController month = params[:location]["startdate(2i)"] year = params[:location]["startdate(1i)"] if [day, month, year].none?(&:blank?) - if Date.valid_date?(day.to_i, month.to_i, year.to_i) + if Date.valid_date?(year.to_i, month.to_i, day.to_i) @location.startdate = Time.zone.local(year.to_i, month.to_i, day.to_i) @location.save! redirect_to scheme_location_check_answers_path(@scheme, @location)