From ad6568444da90c6ca9652d48fdebf18d361fdde9 Mon Sep 17 00:00:00 2001 From: Nicolas Lempereur Date: Wed, 20 Oct 2021 10:01:41 +0000 Subject: [PATCH] [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) --- addons/mail/static/src/js/views/activity/activity_cell.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/mail/static/src/js/views/activity/activity_cell.js b/addons/mail/static/src/js/views/activity/activity_cell.js index 7dc63d587ad..fe5b4e204f8 100644 --- a/addons/mail/static/src/js/views/activity/activity_cell.js +++ b/addons/mail/static/src/js/views/activity/activity_cell.js @@ -27,7 +27,7 @@ const ActivityCell = KanbanActivity.extend({ _render() { // replace clock by closest deadline const $date = $('
'); - 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(), {