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

@ -17,6 +17,15 @@ class Champ < ActiveRecord::Base
mandatory
end
def data_provide
return 'datepicker' if (type_champ == 'datetime') && !(BROWSER.value.chrome? || BROWSER.value.edge?)
return 'typeahead' if type_champ == 'address'
end
def data_date_format
('dd/mm/yyyy' if type_champ == 'datetime')
end
def same_hour? num
same_date? num, '%H'
end