diff --git a/app/controllers/concerns/fields/date_and_time_support.rb b/app/controllers/concerns/fields/date_and_time_support.rb index 81a6be7..2ba6c80 100644 --- a/app/controllers/concerns/fields/date_and_time_support.rb +++ b/app/controllers/concerns/fields/date_and_time_support.rb @@ -4,7 +4,7 @@ module Fields::DateAndTimeSupport def assign_date_and_time(strong_params, attribute) attribute = attribute.to_s time_zone_attribute = "#{attribute}_time_zone" - if strong_params.dig(attribute).present? + if strong_params.dig(attribute).present? && strong_params.dig(time_zone_attribute).present? time_zone = ActiveSupport::TimeZone.new(strong_params[time_zone_attribute] || current_team.time_zone) strong_params.delete(time_zone_attribute) strong_params[attribute] = time_zone.strptime(strong_params[attribute], t("global.formats.date_and_time"))