Revert "Remove data_provide and data_date_format attributes"

This reverts commit 273b3f2faf.
This commit is contained in:
Mathieu Magnin 2018-01-19 13:20:53 +01:00
parent ccad372036
commit 469aca999b
11 changed files with 51 additions and 16 deletions

View file

@ -1,5 +1,5 @@
%input.form-control{ name: "champs['#{champ.id}']",
placeholder: "JJ/MM/AAAA",
id: "champs_#{champ.id}",
value: champ.date_for_input,
value: champ.value ? champ.object.value : champ.value,
type: "date" }

View file

@ -1,13 +1,18 @@
= render partial: 'users/description/champs/date', locals: { champ: champ }
%input.form-control{ name: "champs['#{champ.id}']",
placeholder: champ.libelle,
id: "champs_#{champ.id}",
value: (champ.value.split(/[ ][0-9]*:[0-9]*/).first if champ.value.present?),
type: champ.type_champ,
'data-provide' => champ.data_provide,
'data-date-format' => champ.data_date_format }
%br
%select.form-control{ name: "time_hour['#{champ.id}']", style: 'width:50px;display:inline;', id: "time_hour_#{champ.id}" }
%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}']", style: 'width:50px;display:inline;', id: "time_minute_#{champ.id}" }
%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