[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 0735547086 but must have
been lost in a refactoring.

opw-2629681

closes odoo/odoo#78938

X-original-commit: 8935899c6fdc21ad6eff9f09af6e474652efbcd2
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
This commit is contained in:
Nicolas Lempereur
2021-10-26 13:22:49 +00:00
parent d09e6904d6
commit ad6568444d
@@ -27,7 +27,7 @@ const ActivityCell = KanbanActivity.extend({
_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(), {