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

Cool !!


Thanks!


hi Soren,



Did the solution suggested by Anurag worked for you? I have similar situation and wants to convert into actual date.



please advise.



Thanks,



Rajan Mehta


find_real_file.png


hi Anurag,



I have similar situation and convert days ago to actual date. I have snap attached here with.



Please advise.



Thanks,



Rajan Mehta



find_real_file.png


Goran WitchDoc
ServiceNow Employee
ServiceNow Employee

Sadly I dont think there is for sn-time-ago. It seemed to be saved backend. Some directives are visible. For example <sp-category-list-item> can be found under "angular providers". There you also can the "options" there is that you can use, like "page".



Lets try to push them to document these as well as possible.



//Göran


smeadows2
Tera Contributor

From what I've discovered through a bit of trial and error there are 2 directives that show this sort of info..



<sn-time-ago timestamp="your_date_time_here"/> - is a bit more granular in that it shows hours ago then rounding up to days etc..



<sn-day-ago date="your_date_time_here"/> - has more rounding and generalization of time.. i.e. if less than 24 hours would show 'Today'..., shows things like 'about a month ago'.. etc..



Would be good to have these fully documented so we know all the nuances with regards to how a date/time is displayed with regards to its age.