From e403eec89bf1e834ff34d4399e2786fe9f762d99 Mon Sep 17 00:00:00 2001 From: "Loan (LSE)" Date: Fri, 18 Aug 2023 12:06:46 +0000 Subject: [PATCH] [FIX] mail: "Invalid Date" errors on iOS Safari MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Before this commit: JS errors on iOS with Safari's browser due to the date syntax not being supported: ```js new Date("2023-08-18 14:02:53") -> Invalid Date ``` This does prevent Odoo's backend to start up on the browser and the app on iOS devices. opw-3465337 closes odoo/odoo#132461 X-original-commit: a39391d0df644fce86f435ba3f39e7634d8e5172 Signed-off-by: Alexandre Kühn (aku) --- addons/mail/static/src/core/common/thread_model.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/mail/static/src/core/common/thread_model.js b/addons/mail/static/src/core/common/thread_model.js index aa676ad4439..846dbeaa60e 100644 --- a/addons/mail/static/src/core/common/thread_model.js +++ b/addons/mail/static/src/core/common/thread_model.js @@ -3,6 +3,7 @@ import { ScrollPosition } from "@mail/core/common/scroll_position_model"; import { createLocalId } from "@mail/utils/common/misc"; +import { deserializeDateTime } from "@web/core/l10n/dates"; import { _t } from "@web/core/l10n/translation"; import { Deferred } from "@web/core/utils/concurrency"; @@ -430,7 +431,7 @@ export class Thread { if (!this.last_interest_dt) { return undefined; } - return luxon.DateTime.fromISO(new Date(this.last_interest_dt).toISOString()); + return deserializeDateTime(this.last_interest_dt); } /**