From 2a162d9be71ee00f7698dda7075801ef8213c1d4 Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Wed, 4 Feb 2015 14:31:32 +0100 Subject: [PATCH] [FIX] web: widget date handling user timezone When converting a datetime field to date, using the widget date, the date time value was just cropped, removing the hours, therefore ignoring the user time zone. For instance, if the user was in UTC + 1, for a date time 02/02/2015 00:30:00, applying the widget date on this datetime had as result 02/01/2015, due to the fact the UTC value of the datetime field was 02/01/2015 23:30:00 fixes #4420 opw-621281 --- addons/web/static/src/js/formats.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/web/static/src/js/formats.js b/addons/web/static/src/js/formats.js index 80719d708ab..cddeced29ca 100644 --- a/addons/web/static/src/js/formats.js +++ b/addons/web/static/src/js/formats.js @@ -191,7 +191,7 @@ instance.web.format_value = function (value, descriptor, value_if_empty) { + ' ' + normalize_format(l10n.time_format)); case 'date': if (typeof(value) == "string") - value = instance.web.str_to_date(value.substring(0,10)); + value = instance.web.auto_str_to_date(value); return value.toString(normalize_format(l10n.date_format)); case 'time': if (typeof(value) == "string")