Hide seconds on a duration field

mkader
Kilo Guru

Hello,

I am trying to find the best way to hide seconds from a duration field that we have. I am using something from another community post I found earlier. I was advised by a member on my team to modify the attributes on the field. How can I do that through an attribute?

This is what I have to currently hide the seconds and it works, but there is a temporarily glimpse at the seconds field while the page is loading:

function onLoad() {
    g_form.getElement('ni.pm_project.effortdur_sec').style.display='none';
}

Thanks!

1 ACCEPTED SOLUTION

Absolutely highly NOT recommended, for instance refer to the following official article:

https://hi.service-now.com/kb_view.do?sysparm_article=KB0692555

If I have answered your question, please mark my response as correct and helpful.

Thank you very much

Cheers
Alberto

View solution in original post

11 REPLIES 11

Willem
Giga Sage
Giga Sage

Here is the article that is linked to using DOM manipulation.

They set additional styling elements so the field looks a bit more in line with the rest. Note they hide minutes as well, so you have to adjust their script:

https://community.servicenow.com/community?id=community_question&sys_id=2a52b224db09df404fc2f4621f96...

I tried Olegs way as well and it looked the same as the solution I am currently using