demarches-normaliennes/app/components/editable_champ/datetime_component.rb

10 lines
257 B
Ruby
Raw Normal View History

class EditableChamp::DatetimeComponent < EditableChamp::EditableChampBaseComponent
2022-08-12 10:45:04 +02:00
def datetime_start_year(date)
if date == nil || date.year == 0 || date.year >= Date.today.year - 1
Date.today.year - 1
else
date.year
end
end
end