From a034a17d37b7018e48cd2dd5726b4c8c7cb41cee Mon Sep 17 00:00:00 2001 From: len-odoo Date: Fri, 5 Oct 2018 11:28:48 +0000 Subject: [PATCH] [FIX] survey: fix date picker template and validation The date picker widget was set to text instead of date. Then we needed to fix the date validation at form submit. opw 1890130 closes odoo/odoo#27448 --- addons/survey/static/src/js/survey.js | 2 +- addons/survey/views/survey_templates.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/survey/static/src/js/survey.js b/addons/survey/static/src/js/survey.js index eb8f451aa39..145005790ec 100644 --- a/addons/survey/static/src/js/survey.js +++ b/addons/survey/static/src/js/survey.js @@ -134,7 +134,7 @@ if(!the_form.length) { var date_fields = $form.find('div.date > input.form-control'); for (var i=0; i < date_fields.length; i++) { var el = date_fields[i]; - var moment_date = $(el).data('DateTimePicker').date(); + var moment_date = moment(el.value); if (moment_date) { moment_date.toJSON = function () { return this.clone().locale('en').format('YYYY-MM-DD'); diff --git a/addons/survey/views/survey_templates.xml b/addons/survey/views/survey_templates.xml index 76d16e38041..131c5c75a60 100644 --- a/addons/survey/views/survey_templates.xml +++ b/addons/survey/views/survey_templates.xml @@ -238,7 +238,7 @@