demarches-normaliennes/app/views/users/description/champs/_datetime.html.haml
Xavier J 4355d4775a Add type de champ date
Add hour and minute on UI for datetime
2016-06-22 11:25:41 +02:00

21 lines
No EOL
898 B
Text

%input.form-control{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: champ.type_champ,
'data-provide' => champ.data_provide,
'data-date-format' => champ.data_date_format}
%select.form-control{name:"time_hour['#{champ.id}']", style: 'margin-left: 5px', 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.form-control{name:"time_minute['#{champ.id}']", id:"time_minute_#{champ.id}"}
- (0..59).each do |num|
- num = "%.2i" %num
- if num.to_i%5 == 0
%option{value: num, selected: (:selected if champ.same_minute?(num))}
= num
min