demarches-normaliennes/app/views/new_gestionnaire/dossiers/champs/_datetime.html.haml
2017-09-06 11:11:30 +02:00

22 lines
879 B
Text

= render partial: 'new_gestionnaire/dossiers/champs/champ_label', locals: { champ: champ }
.datetime
%input{ name: "champs['#{champ.id}']",
placeholder: champ.libelle,
id: "champs_#{champ.id}",
value: (champ.value.split(/[ ][0-9]*:[0-9]*/).first unless champ.value.nil?),
type: 'date',
required: champ.mandatory }
%select{ name: "time_hour['#{champ.id}']", id: "time_hour_#{champ.id}", required: champ.mandatory }
- (0..23).each do |num|
- num = "%.2i" %num
%option{ value: num, selected: (:selected if champ.same_hour?(num)) }
= num
h
%select{ name: "time_minute['#{champ.id}']", id: "time_minute_#{champ.id}", required: champ.mandatory }
- (0..55).step(5) do |num|
- num = "%.2i" %num
%option{ value: num, selected: (:selected if champ.same_minute?(num)) }
= num
min