Skip to content

feat(chat): show message timestamp #8957

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mislavlukach
Copy link
Contributor

  • This change is worth documenting at https://docs.all-hands.dev/
  • Include this change in the Release Notes. If checked, you must provide an end-user friendly description for your change below

End-user friendly description of the problem this fixes or functionality this introduces.


Summarize what the PR does, explaining any non-trivial design decisions.
This PR creates 2 hooks.

  1. use-localized-date-formatter - idea is to use locale from our react i18n instance to find how the date should by formatted. Additionally, it accepts formatType which allows you to pick between only showing hh:mm and showing the full date (hours included).
  2. use-relative-date-formatter - utilize 1. hook to provide flexible way to render dates in UI. If the date is today - this hook will pick formatType which shows only hh:mm, otherwise it picks full dat formatter.

Example are in the images below:
today
old
localized


Link of any specific issues this addresses:

Copy link
Member

@amanape amanape left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM but will wait for @rbren's approval. You just need to fix issues presented when running npx tsc

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.

2 participants