Merge pull request #3329 from pengfeidong/fix_3282_datatime_with_empty_value

[fix #3282] add empty value for type_champ datatime
This commit is contained in:
Mathieu Magnin 2019-02-01 13:46:11 +01:00 committed by GitHub
commit 9728721a12
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,4 +1,4 @@
- parsed_value = champ.value.present? ? Time.zone.parse(champ.value) : Time.zone.now
- parsed_value = champ.value.present? ? Time.zone.parse(champ.value) : nil
.datetime
= form.datetime_select(:value, selected: parsed_value, start_year: 1950, end_year: 2100, minute_step: 5)
= form.datetime_select(:value, selected: parsed_value, start_year: 1950, end_year: 2100, minute_step: 5, include_blank: true)