Skip to content
Snippets Groups Projects
Commit 122ba218 authored by Nicolas Lempereur's avatar Nicolas Lempereur
Browse files

[FIX] mail: activity view=>no tz for deadline date


In activity view, the deadline date that has no timezone is formatted
from UTC to local timezone, so if the timezone is negative, we display
by error the previous day (eg. 24 october instead of 25 october).

With this commmit, we interpret the date in local timezone so there is
no timezone issue.

note: no test added since this only happen on browser with negative
timezone which would be hard to test.

note: this was fixed similarily in 13.0 with 07355470 but must have
been lost in a refactoring.

opw-2629681

closes odoo/odoo#78681

Signed-off-by: default avatarNicolas Lempereur (nle) <nle@odoo.com>
parent b9c180dd
No related branches found
No related tags found
No related merge requests found
......@@ -14,7 +14,7 @@ odoo.define("mail.ActivityCell", function (require) {
_render() {
// replace clock by closest deadline
const $date = $('<div class="o_closest_deadline">');
const date = new Date(this.record.data.closest_deadline);
const date = moment(this.record.data.closest_deadline).toDate();
// To remove year only if current year
if (moment().year() === moment(date).year()) {
$date.text(date.toLocaleDateString(moment().locale(), {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment