From 5738a046bebda93983da5fc3e31c674591e9b2e3 Mon Sep 17 00:00:00 2001 From: David Beguin Date: Thu, 22 Nov 2018 16:50:04 +0100 Subject: [PATCH] [FIX] survey : fix datetimepicker initialization - BS4 Since BS4, input-group is used instead of form-controll. The initialisation was not correctly made because it didn't find the datetimepicker. There were several resulting issues: - Max and Min date were not taken into account - Clicking on the text area of date field was not opening the datetimepicker as config was not defined (allowInputToggle option) Task ID : 1911291 Closes PR #28966 --- addons/survey/static/src/js/survey.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/survey/static/src/js/survey.js b/addons/survey/static/src/js/survey.js index 145005790ec..22cef677c45 100644 --- a/addons/survey/static/src/js/survey.js +++ b/addons/survey/static/src/js/survey.js @@ -183,7 +183,7 @@ 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(){ - $('.form-control.date').datetimepicker({ + $('.input-group.date').datetimepicker({ format : time.getLangDateFormat(), minDate: moment({ y: 1900 }), maxDate: moment().add(200, "y"),