EmbeddedChat icon indicating copy to clipboard operation
EmbeddedChat copied to clipboard

feat: Add timeStamps in attached text

Open thepiyush-303 opened this issue 11 months ago • 3 comments

Brief Title

Now text attachments also include timeStamps beside username just like RC

I have added timestamp in the following way:

if message is from previous month then show date in 'january 28,2025' format.
if message is from previous week but same month then show the date '01/02/2025' format
if message is from same week then show 'day, time'
is message is from same day then show 'time'.

It is inspired by the approach that RC follows, i implement it and found some responsive issues so i also fixed them, check final changes is video.

Acceptance Criteria fulfillment

  • [x] Reverse the order of showing message before attachment, since RC follow attachment before message so that I reverse the order
  • [x] Include timeStams in both simple and nested-attachment

Fixes #873

Video/Screenshots

https://github.com/user-attachments/assets/883434c8-60b2-4909-bee9-20076f60ec75

PR Test Details

Note: The PR will be ready for live testing at https://rocketchat.github.io/EmbeddedChat/pulls/pr-875 after approval. Contributors are requested to replace <pr_number> with the actual PR number.

thepiyush-303 avatar Jan 12 '25 17:01 thepiyush-303

In EC, the choice between username or name is customizable: You will have to make it dynamic :

Remove @ sign from attachment because RC also doesn't include it.

Spiral-Memory avatar Jan 27 '25 16:01 Spiral-Memory

@Spiral-Memory Done. image

any other changes?

thepiyush-303 avatar Jan 27 '25 19:01 thepiyush-303

(same video as above)

https://github.com/user-attachments/assets/883434c8-60b2-4909-bee9-20076f60ec75

Hey @Spiral-Memory, I have added timestamp in the following way:

  • if message is from previous month then show date in 'january 28,2025' format.
  • if message is from previous week but same month then show the date '01/02/2025' format
  • if message is from same week then show 'day, time'
  • is message is from same day then show 'time'.

It is inspired by the approach that RC follows, i implement it and found some responsive issues so i also fixed them, check final changes is video.

thepiyush-303 avatar Feb 06 '25 16:02 thepiyush-303