react-chat-window icon indicating copy to clipboard operation
react-chat-window copied to clipboard

Add date below the message

Open vkhattar opened this issue 8 years ago • 5 comments
trafficstars

Hi I want to know the date when the text is sent, its more of a feature request. Example) {type: 'text', author: "them", data: { text: "You've got to have a story.", date: "Tue, 25 Jul 2017 22:53:41 GMT" }}

vkhattar avatar Nov 14 '17 23:11 vkhattar

That's a good idea @vkhattar -- let's think about the other kinds of dates we might need so we get the names right (eg sent, received, read, etc) and add this as a feature req.

It won't make it into the next version, but it may appear later.

Important to note however, you can have your message objects have whatever fields you want. react-chat-window will just ignore extraneous ones. I want to leave this open because I think the UI should have the option of showing some date indicators, but it's not clear what ones or what that might look like.

dharness avatar Nov 14 '17 23:11 dharness

I did add something locally, but could not make a pull request as I did not fork it. For now i am just adding the date with the text, it looks ugly but does get the job done.

vkhattar avatar Nov 15 '17 17:11 vkhattar

@dharness -- Any update on this feature? I'm planning to use this library for one of my projects and would require this feature as part of it. If you can guide me through the implementation, I can develop it for you and create a PR too :)

eswarasai avatar Mar 21 '18 17:03 eswarasai

I'm pretty swamped, but I'd recommend putting it here: https://github.com/dharness/react-chat-window/blob/master/src/components/Messages/index.js

dharness avatar Mar 21 '18 17:03 dharness

I'd like to open this to opinions and suggestions for the design. Should the date appear for every message? Above the bubble, below it, with a time, with the day of week, with relative times (5 minutes ago, yesterday), only at intervals of greater than X time, should there be a break in the convo when it's a new day... there's a lot we need to specify if we want to see this feature!

heatherbooker avatar Jul 19 '19 20:07 heatherbooker