fix: show unambiguous date for older "Last login" timestamps#1333
Open
ManojPawar2 wants to merge 1 commit into
Open
fix: show unambiguous date for older "Last login" timestamps#1333ManojPawar2 wants to merge 1 commit into
ManojPawar2 wants to merge 1 commit into
Conversation
`formatTimestamp` rendered every non-today timestamp as just a weekday and time (e.g. "Tuesday 10:49 PM"), so a login from 90 days ago looked identical to one from earlier this week with no way to tell them apart. Replace the weekday-only format with an explicit short month, day and year, so older logins now read like "Mar 3, 2026, 10:49 PM". Today's logins keep showing only the time. This also aligns the "Last login" field with how dates are formatted elsewhere in the app (formatTimestampGetDate, Message.js). Closes RocketChat#1313
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
The Last login field in the User Information panel was ambiguous for any login that wasn't from today.
formatTimestamprendered non-today timestamps as just a weekday and time — e.g.Tuesday 10:49 PM— with no date. A login from 90 days ago looked identical to one from earlier this week, so there was no way to tell how old it actually was.Fixes #1313
Root cause
packages/react/src/lib/formatTimestamp.jsformatted non-today timestamps using only the weekday name:The weekday repeats every 7 days, so the output is ambiguous for anything older than a week. This is also inconsistent with the rest of the app, which already shows full dates (
formatTimestampGetDate, and date-fns formatting inMessage.js).Fix
Render non-today timestamps with an explicit short month, day and year, while keeping today's logins as time-only:
Resulting output:
Timestamp | Before | After -- | -- | -- 90 days ago | Tuesday 10:49 PM | Mar 3, 2026, 10:49 PM A week ago | Wednesday 9:25 AM | Jun 18, 2026, 9:25 AM Today | 9:25 AM | 9:25 AM (unchanged)Files changed: 1 —
packages/react/src/lib/formatTimestamp.jsScope:
formatTimestampis used only by the "Last login" field, so the change is fully contained and does not affect message timestamps or any other view.Acceptance Criteria fulfillment
Non-today "Last login" values show an unambiguous date with year
Logins of different ages are now visually distinguishable
Today's logins still display only the time
Output style is consistent with date formatting used elsewhere in the app
How to test
Open the User Information panel for a user whose last login is older than a few days.
Confirm the Last login field shows a full date with year, e.g.
Mar 3, 2026, 10:49 PM, instead of just a weekday.Open the panel for a user who logged in today and confirm it still shows only the time, e.g.
9:25 AM.Video/Screenshots
N/A — text-only formatting change in the Last login field.