78
Views
5
Comments
Is there a way to display day in chat ?
Application Type
Reactive
Service Studio Version
11.53.0 (Build 60533)

Hi community,
For the purpose on my current project, I'm using a chat.
I'd like to be able to display the day when a message was sent. Currently I only retrieve the time.

 

But, thing is I save the CurrDateTime value in our DateTime attribute as you can see on the second screen capture.

Ideally, that would be nice to be able to use the day as a separator. Did anyone of you already had this issue or have any idea how I can achieve this ?

Regards :) 

2021-04-17 09-53-48
José Gonçalves

Hi Vincent,

which component are you using for the chat?

You can customize the component and add your day to the message. Although note if you change the component it will not be able to receive updates from the owner.

Regards

UserImage.jpg
Vincent Perhirin

Hi José
In the project we using the ChatMessage component.
Here a screen shot of what we have.

You suggest I customize this ChatMessage component ? 

2021-04-17 09-53-48
José Gonçalves

Yes, you can clone OutSystemsUI module and copy the widget to your CW module:

Customize the widget by insert a input variable Date and add it to the block:

Don't forget this widget will not receive updates from OutSystems since now it's outside OutSystemsUI.

Regards

UserImage.jpg
Vincent Perhirin

Thank you José,
I'll try you solution and let you know !

Thanks ! 

2025-01-11 20-59-19
Tim Morris

I didn't really love the ChatMessage widget displaying the time only, so I put the date/time directly into [Content] placeholder under the message. This also allowed me to create a simple function that displays the date/time in a pretty date format using "Today" and "Yesterday" instead of the date. 

You can get the full demo implementation from the Forge: https://www.outsystems.com/forge/component-overview/21668/chat-demo-o11

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.