leapchat icon indicating copy to clipboard operation
leapchat copied to clipboard

Messages show timestamp

Open jimmcgaw opened this issue 7 years ago • 3 comments

Messages should show the time they were sent if date matches current, else just date for past days.

jimmcgaw avatar May 08 '17 14:05 jimmcgaw

Tricky part here is datetime stamps are in GMT, need to detect browser timezone and adjust time, possibly with something like https://www.npmjs.com/package/jstz

jimmcgaw avatar May 08 '17 14:05 jimmcgaw

@jimmcgaw A good time to create/record/pass-to-clients the timestamps is when implementing persistence; Postgres can give each message a timestamp, and also a UUID (which we can use as React keys rather than the strange timestamp-plus-index-string thing I concocted that we're currently using).

elimisteve avatar May 08 '17 22:05 elimisteve

PR for this that I wasn't sure about (efficiency? will React re-render every message every second as the relative timestamps change?): https://github.com/cryptag/leapchat/pull/169

elimisteve avatar Feb 12 '23 10:02 elimisteve