leapchat
leapchat copied to clipboard
Messages show timestamp
Messages should show the time they were sent if date matches current, else just date for past days.
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 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).
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