[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 12:00:00, i.e. the timezone offset was added to the value. opw 779832
This commit is contained in:
@@ -349,7 +349,7 @@ var DateField = Field.extend(/** @lends instance.web.search.DateField# */{
|
||||
var t, v;
|
||||
try {
|
||||
t = (this.attrs && this.attrs.type === 'datetime') ? 'datetime' : 'date';
|
||||
v = field_utils.parse[t](needle, {type: t});
|
||||
v = field_utils.parse[t](needle, {type: t}, {timezone: true});
|
||||
} catch (e) {
|
||||
return $.when(null);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user