[FIX] mail: activities creation date according to user timezone
Before this commit: When any activity was created, the displayed created date was in UTC time and not adjusted to the user's timezone. The time was not converted according to the user's timezone. After this commit: The activity's created time now displayed is converted from the UTC time stored during the activity's creation. task-3483695 closes odoo/odoo#137684 X-original-commit: d016456c72d7927c10120a556adce9e73227523a Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
This commit is contained in:
@@ -9,6 +9,7 @@ import { AvatarCardPopover } from "@mail/discuss/web/avatar_card/avatar_card_pop
|
||||
import { Component, onMounted, onWillUnmount, useState } from "@odoo/owl";
|
||||
|
||||
import { browser } from "@web/core/browser/browser";
|
||||
import { deserializeDateTime } from "@web/core/l10n/dates";
|
||||
import { _t } from "@web/core/l10n/translation";
|
||||
import { usePopover } from "@web/core/popover/popover_hook";
|
||||
import { useService } from "@web/core/utils/hooks";
|
||||
@@ -50,6 +51,12 @@ export class Activity extends Component {
|
||||
return this.props.data.display_name;
|
||||
}
|
||||
|
||||
get displayCreateDate() {
|
||||
return deserializeDateTime(this.props.data.create_date).toLocaleString(
|
||||
luxon.DateTime.DATETIME_SHORT_WITH_SECONDS
|
||||
);
|
||||
}
|
||||
|
||||
updateDelayAtNight() {
|
||||
browser.clearTimeout(this.updateDelayMidnightTimeout);
|
||||
this.updateDelayMidnightTimeout = browser.setTimeout(
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
<table class="o-mail-Activity-details table table-sm mt-2">
|
||||
<tbody>
|
||||
<tr><td class="text-end fw-bolder">Activity type</td><td><t t-esc="activity.activity_type_id[1]"/></td></tr>
|
||||
<tr><td class="text-end fw-bolder">Created</td><td><t t-esc="activity.create_date"/> by <t t-esc="activity.create_uid[1]"/></td></tr>
|
||||
<tr><td class="text-end fw-bolder">Created</td><td><t t-esc="displayCreateDate"/> by <t t-esc="activity.create_uid[1]"/></td></tr>
|
||||
<tr><td class="text-end fw-bolder">Assigned to</td><td><t t-esc="activity.user_id[1]"/></td></tr>
|
||||
<tr><td class="text-end fw-bolder">Due on</td><td><t t-esc="activity.date_deadline"/></td></tr>
|
||||
</tbody>
|
||||
|
||||
Reference in New Issue
Block a user