RocketChat / RocketChat/EmbeddedChat
bug: "Last login" shows ambiguous weekday with no date for logins older than today
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 165
- Forks
- 381
- Avg merge
- 1d 2h
- Merged PRs (30d)
- 1
Description
Description
In the User Information panel, the Last login field uses formatTimestamp (packages/react/src/lib/formatTimestamp.js), which renders any timestamp that isn't from today as just a weekday + time, with no date:
return isDifferentDay
? `${date.toLocaleDateString('en-US', { weekday: 'long' })} ${formattedTime}`
: formattedTime;
isDifferentDay is only "not today", so every past login collapses to a bare weekday. A login from 3 months ago — or even over a year ago — shows the same kind of string as one from last week, with no way to tell them apart.
Steps to reproduce
- Open the User Information panel for a user whose last login was more than a few days ago.
- Look at the Last login field.
Actual behavior
The field shows only a weekday and time, e.g.:
login 90 days ago : "Tuesday 10:49 PM" (actual: Tue Mar 03 2026)
login 400 days ago: "Sunday 10:49 PM" (actual: Apr 27 2025 — over a year ago)
A 14-month-old login is indistinguishable from a recent one, and no year is ever shown.
Expected behavior
For timestamps that aren't from today, show an unambiguous date (with year), e.g. "Mar 3, 2026, 10:49 PM".
Notes
The codebase already does this correctly elsewhere — the adjacent created at field uses formatTimestampGetDate ("March 5, 2026"), and Message.js formats dates via date-fns format(date, 'MMMM d, yyyy'). So this is an inconsistency in formatTimestamp specifically.
I found this while reading the date-formatting helpers and would like to work on it.
File: packages/react/src/lib/formatTimestamp.js
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with packages/react/src/lib/formatTimestamp.js and compare its non-today branch with formatTimestampGetDate and the date formatting used in Message.js. Update the Last login output so older timestamps include an unambiguous date and year, then verify the User Information panel examples match the expected format.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, react
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 72/100