Skip to content
Snippets Groups Projects
Commit a034a17d authored by len-odoo's avatar len-odoo
Browse files

[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
parent a9ce28bf
Branches
Tags
No related merge requests found
......@@ -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');
......
......@@ -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>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment