From 50798904421a264d6b31171f228d98f3a727bd41 Mon Sep 17 00:00:00 2001 From: Classic298 <27028174+Classic298@users.noreply.github.com> Date: Wed, 7 Oct 2026 14:23:02 +0200 Subject: [PATCH] fix: chats from the last day of a month show under Previous 7 days on the first (#31973) On the first day of a month, chats from the day before were listed under "Previous 7 days" in the sidebar instead of "Yesterday". The same happened on January 1st for chats from December 31st. Any chat from the previous calendar day is now listed under "Yesterday", whatever the month or year. Fixes #31964 --- src/lib/utils/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/utils/index.ts b/src/lib/utils/index.ts index e3abda04d9..cffe41aa64 100644 --- a/src/lib/utils/index.ts +++ b/src/lib/utils/index.ts @@ -1335,7 +1335,7 @@ export const getTimeRange = (timestamp) => { if (nowYear === dateYear && nowMonth === dateMonth && nowDate === dateDate) { return 'Today'; - } else if (nowYear === dateYear && nowMonth === dateMonth && nowDate - dateDate === 1) { + } else if (dayjs(date).isYesterday()) { return 'Yesterday'; } else if (diffDays <= 7) { return 'Previous 7 days';