From bba50078614cbbf20e39dbada76596411e5afafc Mon Sep 17 00:00:00 2001 From: Yash Gadia Date: Mon, 1 Jun 2026 22:52:32 +0530 Subject: [PATCH] fix: show full date in formatTimestamp for non-today timestamps MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit formatTimestamp rendered any timestamp that wasn't from the current day as a bare weekday + time (e.g. "Tuesday 10:49 PM"). This made the "Last login" field in the User Information panel ambiguous: a login from months — or even over a year — ago was indistinguishable from a recent one, and no year was ever shown. Now non-today timestamps include a full date with year (e.g. "Mar 3, 2026, 10:49 PM"), consistent with how createdAt (formatTimestampGetDate) and message dates (date-fns) are already shown. Same-day timestamps still render as time-only. Closes #1313 --- packages/react/src/lib/formatTimestamp.js | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/packages/react/src/lib/formatTimestamp.js b/packages/react/src/lib/formatTimestamp.js index c9555ff155..f7651c9dfa 100644 --- a/packages/react/src/lib/formatTimestamp.js +++ b/packages/react/src/lib/formatTimestamp.js @@ -10,11 +10,17 @@ const formatTimestamp = (timestamp) => { const options = { hour: 'numeric', minute: 'numeric', hour12: true }; const formattedTime = date.toLocaleTimeString('en-US', options); - return isDifferentDay - ? `${date.toLocaleDateString('en-US', { - weekday: 'long', - })} ${formattedTime}` - : formattedTime; + if (!isDifferentDay) { + return formattedTime; + } + + const formattedDate = date.toLocaleDateString('en-US', { + year: 'numeric', + month: 'short', + day: 'numeric', + }); + + return `${formattedDate}, ${formattedTime}`; }; export default formatTimestamp;