From b09c550d0548c6791fc71baa533c3f13984f1f7f Mon Sep 17 00:00:00 2001 From: natdeanlewissoftwire Date: Tue, 29 Nov 2022 12:06:56 +0000 Subject: [PATCH] fix: correct date order --- app/controllers/locations_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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)