Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Change time "ago" on Service Portal

priisholm
Mega Expert

Hi guys! 🙂

In the ticket-widget'en on the Service Portal (Helsinki), ServiceNow will show date/times as "ago" (and it doesn't matter what the user-preferences are: calender, ago or both)

find_real_file.png

If you move the mouse over "6 min ago", ServiceNow will actually show the date+time:

find_real_file.png

In the ticket-conversions widget (HTML-part) it show the "sn-time-ago timestamp".

Of course I can clone the widget and change that part, but to what?

find_real_file.png

Thanks

Soren

21 REPLIES 21

I'll give them a nudge again and see if we can push this upwards.



//Göran


SRJ
Tera Contributor

Its works fine in the Created date , but not in the first highlighted part, Could you please suggest what to change



find_real_file.png


Ishwar
Tera Contributor

Hi,

For first Highlighted Part

Just replace the -

<sn-time-ago time-from="::e.sys_created_on"/>

with

{{e.sys_created_on_adjusted}}

 


This worked for me.

Regards,
Ishwar Agam

Shiri
Kilo Contributor

Was this question resolved ?

Wendy12
Tera Contributor

This worked for me.  Hopefully helpful for others.

 

1. Copied the ticket fields widget. 

2. In the HTML template:

  • Commented out the sn-time-ago line
  • Added in the span line

find_real_file.png

3. In the Server script:

  • added in the data.created line

find_real_file.png

 

4. Eat cake!

find_real_file.png