Skip to content

fix: format last login timestamp with date and input guards - #1402

Open
swarnendusahu10-dotcom wants to merge 1 commit into
RocketChat:developfrom
swarnendusahu10-dotcom:fix/issue-1313-unambiguous-last-login-date
Open

swarnendusahu10-dotcom wants to merge 1 commit into
RocketChat:developfrom
swarnendusahu10-dotcom:fix/issue-1313-unambiguous-last-login-date

Conversation

@swarnendusahu10-dotcom

Copy link
Copy Markdown
Contributor

Summary

Closes #1313.

Resolves an issue in formatTimestamp where all "Last login" timestamps older than today were rendered as only a weekday and time (e.g., Tuesday 10:49 PM), making logins from last week, several months ago, or past years completely indistinguishable.


Problem (Before)

In packages/react/src/lib/formatTimestamp.js:

return isDifferentDay
  ? `${date.toLocaleDateString('en-US', { weekday: 'long' })} ${formattedTime}`
  : formattedTime;

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: "Last login" shows ambiguous weekday with no date for logins older than today

1 participant