How to change the date format in Service Portal additional comment in ticket form

attanhes
Tera Guru

Hi

Can someone please tell me how to change the days and minutes format in the "Ticket form" ticket conversation widget to the actual date and time?

find_real_file.png

5 REPLIES 5

Tom Sienkiewicz
Mega Sage

Hi, OOTB this is not configurable for the new standard ticket form (your screenshot shows the old ticket form - not sure about that one, perhaps you can test if it follows user's preferences?):

find_real_file.png

you would need to add some customization to change it. Either you would need to clone and modify the actual widget displaying the activity log, or perhaps you can add your custom widget which will find all those fields/entries using DOM (by ID, class etc.) and replace those values client-side. I would probably recommend the first approach, but I would even more recommend to think if this requirement is worth it 🙂

Thanks for the update.

What do you mean by ((your screenshot shows the old ticket form ) ? What's the new "Ticket form" looks like? Please send me a screenshot of new view.

Also please let me know which page and which widget I should use.

I am planning to implement this in prod next week, if this is a depredicated widget I can look into fix it.

Please let me know.

Hi,

to see the "new look", please follow this doc:

https://docs.servicenow.com/en-US/bundle/sandiego-servicenow-platform/page/build/service-portal/conc...

Before you make a decision to switch to this new version (which is highly recommended, as the old one is deprecated, I believe) - make sure to analyze any customizations you might have made, and the overall impact.

I would say the standard ticket form is nice because it has a lot of configuration options OOTB, without having to script.

Alex Sastre Bra
Tera Guru

Hi @attanhes 

I don't know if this was resolved but in my case, i need to edit the HTML of the widget. Workaround:

  1. Search the widget where you want to change the format. (For me was CSM Standard Ticket Conversation)
  2. Search in the HTML this: sn-time-ago timestamp.
  3. You will get something like this:

 

<small class="text-muted">
   <span class="glyphicon glyphicon-time" aria-hidden="true" tabindex="-1" />
     <sn-time-ago timestamp="::e.sys_created_on" />
 </small>​

 

  • Make this change: 

 

<small class="text-muted">
    <span class="glyphicon glyphicon-time" aria-hidden="true" tabindex="-1" />
     <!--sn-time-ago timestamp="::e.sys_created_on" /-->
     <span>{{::e.sys_created_on}}</span>
</small>​

 

  • Check if this works:AlexSastreBra_0-1701251897153.png

Maybe the ::e.sys_created_on is different on your widget. The thing is to get what is inside timestamp:

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

And put it inside a new span tag betwen {{ }}:

<span>{{::e.sys_created_on}}</span>

 

Please mark Correct and click the Thumb up if my answer helps you resolve your issue. Thanks!

Alex Sastre