[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
This commit is contained in:
len-odoo
2018-10-05 11:28:50 +00:00
parent a9ce28bfb1
commit a034a17d37
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -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');
+1 -1
View File
@@ -238,7 +238,7 @@
<template id="date" name="Date box">
<div class='input-group date'>
<input type="text" date="true" class="form-control date" t-att-name="prefix"/>
<input type="date" class="form-control" t-att-name="prefix"/>
</div>
</template>