From 98713236b74527b28c581519dc5b7b38450106d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=85=AC=E6=98=8E?= <83812544+Ed1s0nZ@users.noreply.github.com> Date: Mon, 29 Dec 2025 19:17:16 +0800 Subject: [PATCH] Add files via upload --- web/static/js/chat.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/web/static/js/chat.js b/web/static/js/chat.js index ca187633..8554db22 100644 --- a/web/static/js/chat.js +++ b/web/static/js/chat.js @@ -1449,7 +1449,9 @@ function formatConversationTimestamp(dateObj, todayStart, yesterdayStart) { if (!(dateObj instanceof Date) || isNaN(dateObj.getTime())) { return ''; } - const referenceToday = todayStart || new Date(dateObj.getFullYear(), dateObj.getMonth(), dateObj.getDate()); + // 如果没有传入 todayStart,使用当前日期作为参考 + const now = new Date(); + const referenceToday = todayStart || new Date(now.getFullYear(), now.getMonth(), now.getDate()); const referenceYesterday = yesterdayStart || new Date(referenceToday.getTime() - 24 * 60 * 60 * 1000); const messageDate = new Date(dateObj.getFullYear(), dateObj.getMonth(), dateObj.getDate());