react-chat-window
react-chat-window copied to clipboard
Add date below the message
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" }}
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.
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.
@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 :)
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
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!