From 79c15f832ce53af76f39880bec16f0e8358dae52 Mon Sep 17 00:00:00 2001 From: Christophe Matthieu Date: Tue, 29 Jan 2013 16:35:28 +0100 Subject: [PATCH] [FIX] mail: js change _date to date for display date of message. display complete date if more of 7 days bzr revid: chm@openerp.com-20130129153528-cffz4dbbn6i80euw --- addons/mail/static/src/js/mail.js | 7 ++++--- addons/mail/static/src/xml/mail.xml | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/addons/mail/static/src/js/mail.js b/addons/mail/static/src/js/mail.js index f428dc043cf..3576f721678 100644 --- a/addons/mail/static/src/js/mail.js +++ b/addons/mail/static/src/js/mail.js @@ -218,7 +218,7 @@ openerp.mail = function (session) { this.author_id = datasets.author_id || false, this.attachment_ids = datasets.attachment_ids || [], this.partner_ids = datasets.partner_ids || []; - this._date = datasets.date; + this.date = datasets.date; this.format_data(); @@ -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) { - this.timerelative = $.timeago(this._date+"Z"); + if (this.date && new Date().getTime()-Date.parse(this.date).getTime() < 7*24*60*60*1000) { + debugger; + this.timerelative = $.timeago(this.date+"Z"); } if (this.type == 'email' && (!this.author_id || !this.author_id[0])) { this.avatar = ('/mail/static/src/img/email_icon.png'); diff --git a/addons/mail/static/src/xml/mail.xml b/addons/mail/static/src/xml/mail.xml index 63f8a10658f..4693adeb1ee 100644 --- a/addons/mail/static/src/xml/mail.xml +++ b/addons/mail/static/src/xml/mail.xml @@ -246,7 +246,7 @@ - +