From 212bbf1f7e6d8e14b4017c1683655ed0e823db3f Mon Sep 17 00:00:00 2001 From: Aaron Bohy Date: Tue, 6 Oct 2015 14:31:36 +0200 Subject: [PATCH] [FIX] mail: thread: messages' date displayed in browser's timezone --- addons/mail/static/src/js/thread.js | 4 ++++ addons/mail/static/src/xml/thread.xml | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/addons/mail/static/src/js/thread.js b/addons/mail/static/src/js/thread.js index e226ac33bb8..190391d94de 100644 --- a/addons/mail/static/src/js/thread.js +++ b/addons/mail/static/src/js/thread.js @@ -2,6 +2,7 @@ odoo.define('mail.ChatThread', function (require) { "use strict"; var core = require('web.core'); +var time = require('web.time'); var Widget = require('web.Widget'); var QWeb = core.qweb; @@ -65,6 +66,9 @@ var Thread = Widget.extend({ _preprocess_message: function (message) { var msg = _.extend({}, message); + // Set the date in the browser timezone + msg.date = moment(time.str_to_datetime(msg.date)).format('YYYY-MM-DD HH:mm:ss'); + // Compute displayed author if (!msg.author_id || !msg.author_id[1]) { msg.displayed_author = msg.email_from || this.options.default_username; diff --git a/addons/mail/static/src/xml/thread.xml b/addons/mail/static/src/xml/thread.xml index 28717bc70a3..da318464b71 100644 --- a/addons/mail/static/src/xml/thread.xml +++ b/addons/mail/static/src/xml/thread.xml @@ -21,7 +21,7 @@
- +
@@ -52,7 +52,7 @@
- - + - on @@ -100,7 +100,7 @@
- +