From 7cf59dc8fecc3e16a2b1d11354e445a68aa87bb7 Mon Sep 17 00:00:00 2001 From: Martin Brennan Date: Mon, 20 Nov 2023 19:21:39 +1000 Subject: [PATCH] FIX: Invalid date when sending chat message in thread (#24455) Fixes a minor issue where "Invalid date" is shown briefly when sending a message in a chat thread. Change to use `new Date()` instead like the channel staged message which does not have this issue. --- plugins/chat/assets/javascripts/discourse/models/chat-thread.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/chat/assets/javascripts/discourse/models/chat-thread.js b/plugins/chat/assets/javascripts/discourse/models/chat-thread.js index dcd059b61e2..eb50f51c757 100644 --- a/plugins/chat/assets/javascripts/discourse/models/chat-thread.js +++ b/plugins/chat/assets/javascripts/discourse/models/chat-thread.js @@ -63,7 +63,7 @@ export default class ChatThread { message.staged = true; message.processed = false; message.draft = false; - message.createdAt ??= moment.utc().format(); + message.createdAt = new Date(); message.thread = this; this.messagesManager.addMessages([message]);