diff --git a/addons/survey/static/src/js/survey.js b/addons/survey/static/src/js/survey.js index 6542f63a3dc..16def6107d2 100644 --- a/addons/survey/static/src/js/survey.js +++ b/addons/survey/static/src/js/survey.js @@ -183,22 +183,26 @@ if(!the_form.length) { // frontend does not load moment locale at all. // so wait until DOM ready with locale then init datetimepicker ready_with_locale.then(function(){ - $('.input-group.date').datetimepicker({ - format : time.getLangDateFormat(), - minDate: moment({ y: 1900 }), - maxDate: moment().add(200, "y"), - calendarWeeks: true, - icons: { - time: 'fa fa-clock-o', - date: 'fa fa-calendar', - next: 'fa fa-chevron-right', - previous: 'fa fa-chevron-left', - up: 'fa fa-chevron-up', - down: 'fa fa-chevron-down', - }, - locale : moment.locale(), - allowInputToggle: true, - keyBinds: null, + _.each($('.input-group.date'), function(date_field){ + var minDate = $(date_field).data('mindate') || moment({ y: 1900 }); + var maxDate = $(date_field).data('maxdate') || moment().add(200, "y"); + $('#' + date_field.id).datetimepicker({ + format : time.getLangDateFormat(), + minDate: minDate, + maxDate: maxDate, + calendarWeeks: true, + icons: { + time: 'fa fa-clock-o', + date: 'fa fa-calendar', + next: 'fa fa-chevron-right', + previous: 'fa fa-chevron-left', + up: 'fa fa-chevron-up', + down: 'fa fa-chevron-down', + }, + locale : moment.locale(), + allowInputToggle: true, + keyBinds: null, + }); }); // Launch prefilling prefill(); diff --git a/addons/survey/views/survey_templates.xml b/addons/survey/views/survey_templates.xml index 0375b26626f..9efe5426187 100644 --- a/addons/survey/views/survey_templates.xml +++ b/addons/survey/views/survey_templates.xml @@ -238,7 +238,9 @@