demarches-normaliennes/app/views/shared/dossiers/editable_champs/_datetime.html.haml
Judith c27b2da90b datetime type de champ: changed the years range from [1950;2100] to [to current year - 1;
current year + 50] (or [entered_date; current_year + 50] if old date already entered) because:
The type_de_champ Datetime is used for close future dates and very close past dates (for accident declaration for ex.)
The select currently has a range from 1950 to 2100, so 70+ years not supposed to be used, leading to:
- many bad data entered (0000 or 1950 to not scroll)
- making it difficult for users to give the proper date (current date is lost in the middle of 149 others) so risk to be lazy and select a random one or genuinely make a mistake
2020-08-13 13:41:45 +00:00

4 lines
259 B
Text

- parsed_value = champ.value.present? ? Time.zone.parse(champ.value) : nil
.datetime
= form.datetime_select(:value, selected: parsed_value, start_year: datetime_start_year(parsed_value), end_year: Date.today.year + 50, minute_step: 5, include_blank: true)