Skip to content

Commit

Permalink
parse unix date
Browse files Browse the repository at this point in the history
  • Loading branch information
omohokcoj committed Feb 9, 2024
1 parent 98c79d2 commit 48d5bee
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/submitters/normalize_values.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,11 @@ def normalize_value(field, value)
if field['type'] == 'text' && value.present?
value.to_s
elsif field['type'] == 'date' && value.present?
Date.parse(value).to_s
if value.is_a?(Integer)
Time.zone.at(value.to_s.first(10).to_i).to_date
else
Date.parse(value).to_s
end
else
value
end
Expand Down

0 comments on commit 48d5bee

Please sign in to comment.