demarches-normaliennes/app/views/new_gestionnaire/dossiers/champs/_datetime.html.haml

22 lines
788 B
Text
Raw Normal View History

= 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' }
%select{ name: "time_hour['#{champ.id}']", id: "time_hour_#{champ.id}" }
- (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}" }
- (0..55).step(5) do |num|
- num = "%.2i" %num
%option{ value: num, selected: (:selected if champ.same_minute?(num)) }
= num
min