From 3843ebd45beb1366cb40191d1ad68694aa4d78fe Mon Sep 17 00:00:00 2001 From: Christophe Matthieu Date: Fri, 1 Feb 2013 10:30:18 +0100 Subject: [PATCH] [FIX] mail: use session.web.str_to_datetime instead of Date.parse bzr revid: chm@openerp.com-20130201093018-24yiklef5bni6ya1 --- addons/mail/static/src/js/mail.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/addons/mail/static/src/js/mail.js b/addons/mail/static/src/js/mail.js index efed773b8c5..0b3bddffde1 100644 --- a/addons/mail/static/src/js/mail.js +++ b/addons/mail/static/src/js/mail.js @@ -243,8 +243,9 @@ openerp.mail = function (session) { /* Convert date, timerelative and avatar in displayable data. */ format_data: function () { //formating and add some fields for render - if (this.date && new Date().getTime()-Date.parse((this.date+'').split('.')[0]).getTime() < 7*24*60*60*1000) { - this.timerelative = $.timeago(this.date+"Z"); + this.date = this.date ? session.web.str_to_datetime(this.date) : false; + if (this.date && new Date().getTime()-this.date.getTime() < 7*24*60*60*1000) { + this.timerelative = $.timeago(this.date); } if (this.type == 'email' && (!this.author_id || !this.author_id[0])) { this.avatar = ('/mail/static/src/img/email_icon.png');