[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
This commit is contained in:
Martin Trigaux
2014-01-21 11:27:25 -02:00
parent c09798bfbb
commit 9a0a02060f
+3
View File
@@ -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':