demarches-normaliennes/app/models/champs/date_champ.rb
2018-06-19 15:20:01 +02:00

14 lines
211 B
Ruby

class Champs::DateChamp < Champ
before_save :format_before_save
private
def format_before_save
self.value =
begin
Date.parse(value).iso8601
rescue
nil
end
end
end