[FIX] mail: thread: messages' date displayed in browser's timezone
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
<t t-foreach="messages" t-as="message">
|
||||
<div t-if="current_day != message.date.split(' ')[0]" class="o_thread_date_separator">
|
||||
<span class="o_thread_date">
|
||||
<t t-raw="moment(message.date, 'YYYY-MM-DD hh:mm:ss').format('LL')"/>
|
||||
<t t-esc="moment(message.date, 'YYYY-MM-DD hh:mm:ss').format('LL')"/>
|
||||
</span>
|
||||
<t t-set="current_day" t-value="message.date.split(' ')[0]"/>
|
||||
</div>
|
||||
@@ -52,7 +52,7 @@
|
||||
</t>
|
||||
|
||||
<small t-att-title="moment(message.date, 'YYYY-MM-DD hh:mm:ss').format('LLL')">
|
||||
- <t t-esc="moment(message.date, 'YYYY-MM-DD hh:mm:ss').format('hh:mm')"/>
|
||||
- <t t-esc="moment(message.date, 'YYYY-MM-DD hh:mm:ss').format('hh:mm A')"/>
|
||||
</small>
|
||||
<t t-if="message.model && (message.model != 'mail.channel') && options.display_document_link">
|
||||
on <a class="o_mail_redirect" href="#" t-att-data-oe-model="message.model" t-att-data-oe-id="message.res_id"><t t-esc="message.record_name"/></a>
|
||||
@@ -100,7 +100,7 @@
|
||||
<t t-name="mail.Attachment">
|
||||
<div t-attf-class="o_attachment #{attachment.upload ? 'o_attachment_uploading' : ''}" t-att-title="attachment.name">
|
||||
<a class="o_image" t-att-href='attachment.url' target="_blank" t-att-data-mimetype="attachment.mimetype" t-attf-data-src="/web/image/#{attachment.id}/100x80">
|
||||
<span class='o_attachment_name'><t t-raw='attachment.name'/></span>
|
||||
<span class='o_attachment_name'><t t-esc='attachment.name'/></span>
|
||||
</a>
|
||||
<t t-if="editable">
|
||||
<div class="o_attachment_delete">
|
||||
|
||||
Reference in New Issue
Block a user