Service Portal <sn-time-ago"/> element - how to show date+time instead of time difference?

Adam Boroch
Tera Contributor

Hello, I am working with clone of OOTB "my-requests-v2" widget and one of the columns is "Updated". It is showing time difference between now and "updated" date. I want to show instead of this just a time and date of last update. As I see there is used element like this:

 

<sn-time-ago timestamp="::item.updated_on"/>

 

Does anyone know if there is a simple solution to change it or do I need change the logic very hard?

 

Kind Regards,

Adam

AdamBoroch_0-1680175222414.png

 

4 REPLIES 4

Muhammad Khan
Mega Sage
Mega Sage

You might find this workaround on below article useful.

The Date/Time TimeAgo format preference does not affect Service Portal 

Daniel R2
Kilo Sage

Hi @Adam Boroch - we have the exact same issue, we would also like to change the time ago to the actual time stamp on this updated column on the My Requests v2 widget. We have followed the link @Muhammad Khan shared and other community posts/support docs however still no luck. 

 

Did you manage to find a solution to this? If so do you mind sharing it with me please?

Peter Bodelier
Giga Sage

Hi @Daniel R2 , @Adam Boroch 

This solution requires customizing the widget: (Clone widget preferred)

 

Replace <sn-time-ago timestamp="::item.updated_on"/> by {{::item.updated_on}} in the html


Help others to find a correct solution by marking the appropriate response as accepted solution and helpful.

akashk
Tera Contributor

@Peter Bodelier 

Maybe in recent Version of this Widget, its not working by changing the code line as above (I can see the lines in 62 and 144). There is also another error which is seen, however has a KB Article KB1641841 to solve, but is very recently updated (Nov 6, 2024)

Any lead on this issue would be helpful.