diff options
| author | Nans Lefebvre <len@odoo.com> | 2019-02-06 14:33:57 +0000 |
|---|---|---|
| committer | Nans Lefebvre <len@odoo.com> | 2019-02-06 14:39:04 +0000 |
| commit | 98d042484868e53ff801ff891cabf4afbfd8a059 (patch) | |
| tree | bc69f51ab340978f0e55bb9db395ce8814ce355f /addons/survey/static/src/js | |
| parent | 495d475d1d3ab6726d7e5d5f2dd8044e60d1a3da (diff) | |
[FIX] survey: support custom server date format in (frontend) surveys
The library moment.js does not support custom date formats anymore.
The following warning is given:
Deprecation warning: value provided is not in a recognized ISO format.
As a result, the moment contains 'Invalid Date',
which would remove possibility to complete a survey containing a date
in any format different than the default.
opw 1930152
closes odoo/odoo#30894
Diffstat (limited to 'addons/survey/static/src/js')
| -rw-r--r-- | addons/survey/static/src/js/survey.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/survey/static/src/js/survey.js b/addons/survey/static/src/js/survey.js index 161f3807e6c..376c6c4da28 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.value !== '' ? moment(el.value) : ''; + var moment_date = el.value !== '' ? field_utils.parse.date(el.value) : ''; if (moment_date) { moment_date.toJSON = function () { return this.clone().locale('en').format('YYYY-MM-DD'); |
