diff options
| author | Aaron Bohy <aab@odoo.com> | 2017-11-13 14:05:09 +0100 |
|---|---|---|
| committer | Aaron Bohy <aab@odoo.com> | 2017-11-13 14:07:40 +0100 |
| commit | 9bea73514554a92dff65ca90a600a7be6ee7b009 (patch) | |
| tree | 60a9b03d06d68e5ed39e524cec4acdda816ca176 /addons/web/static/src | |
| parent | fa5ee6ed2634b1a5b4388efb2c6ab6ae80356f28 (diff) | |
[FIX] web: search view: autocomplete on datetime fields
... gives wrong values due to the timezone.
For instance, let's assume that the browser timezone of the user
is UTC+2, and the user types 10/09/2017 10:00:00 in a searchview
with a datetime field in its arch (i.e. which autocompletes on a
datatime field). Before this rev., the suggested value was
10/09/2017 08:00:00, i.e. the timezone offset was substracted from
the value.
Diffstat (limited to 'addons/web/static/src')
| -rw-r--r-- | addons/web/static/src/js/views/search_inputs.js | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/addons/web/static/src/js/views/search_inputs.js b/addons/web/static/src/js/views/search_inputs.js index edeffd874b0..e8b2c87baae 100644 --- a/addons/web/static/src/js/views/search_inputs.js +++ b/addons/web/static/src/js/views/search_inputs.js @@ -351,7 +351,8 @@ var DateField = Field.extend(/** @lends instance.web.search.DateField# */{ return $.when(null); } - var m = moment(v, t === 'datetime' ? 'YYYY-MM-DD HH:mm:ss' : 'YYYY-MM-DD'); + // THIS SHOULD BE FORWARDPORTED UP TO SAAS-15, NOT LATER + var m = moment.utc(v, t === 'datetime' ? 'YYYY-MM-DD HH:mm:ss' : 'YYYY-MM-DD'); if (!m.isValid()) { return $.when(null); } var d = m.toDate(); var date_string = formats.format_value(d, this.attrs); |
