From 9a0a02060fa048ce92ee0dab1bfbdcff63573237 Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Tue, 21 Jan 2014 11:27:25 -0200 Subject: [PATCH] [FIX] format_value: when formating to date, make sure not converting from a datetime string as would make timezones apply and lead to a possible day change bzr revid: mat@openerp.com-20140121132725-k9f8hna3lg7nq7g8 --- addons/web/static/src/js/formats.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/addons/web/static/src/js/formats.js b/addons/web/static/src/js/formats.js index dd0a9040b6b..640d919f4c1 100644 --- a/addons/web/static/src/js/formats.js +++ b/addons/web/static/src/js/formats.js @@ -191,6 +191,9 @@ instance.web.format_value = function (value, descriptor, value_if_empty) { + ' ' + normalize_format(l10n.time_format)); case 'date': if (typeof(value) == "string") + if (value.length > 10) + // in case value is a datetime, strip to avoid time manipulation + value = value.substring(0,10); value = instance.web.auto_str_to_date(value); return value.toString(normalize_format(l10n.date_format)); case 'time':