[Fix #376] Force every browser to use native input[type=date] on date champ

This commit is contained in:
Mathieu Magnin 2017-06-09 11:45:50 +02:00
parent 2653862fa7
commit 41a5ed59f3
4 changed files with 26 additions and 8 deletions

View file

@ -12,12 +12,12 @@ class Champ < ActiveRecord::Base
end
def data_provide
return 'datepicker' if (type_champ == 'datetime' || type_champ == 'date') && !(BROWSER.value.chrome? || BROWSER.value.edge?)
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' || type_champ == 'date')
('dd/mm/yyyy' if type_champ == 'datetime')
end
def same_hour? num