- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-18-2018 04:42 AM
Hi guys, we use a duration type field for 'Downtime' on our change form. Is it possible to hide or remove the box that represents seconds on this duration field?
Many thanks.
Solved! Go to Solution.
- Labels:
-
User Interface (UI)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-18-2018 05:37 AM
Hi,
You can do this by two ways:
2. Changing the system property - Go to System Properties > System > Time Format and knocked off the :ss (seconds) and it will remove the SS part from your field but it will affect all fields of Time format within the system as this is Global change.
Thank you!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-18-2018 06:46 AM
No worries, I got it working by commenting out the minutes part of olegki's code (DOM manipulation).
So working onLoad client script to hide seconds from type duration field here:
function onLoad() {
var doc = g_form.getControl("DURATIONFIELDHERE").ownerDocument,
win = doc.defaultView,
table = g_form.getTableName(),
hideMinSecFields = function (field) {
function getElem (field, suffix, prefix) {
return doc.getElementById((prefix || "") + table + "." + field + (suffix || ""));
}
var controlHour = getElem(field, "dur_hour", "ni."),
controlMin = getElem(field, "dur_min", "ni."),
controlSec = getElem(field, "dur_sec", "ni."), cs;
if (controlMin != null && controlMin.style != null) {
controlMin.style.display = "none";
}
//if (controlSec != null && controlSec.style != null) {
if (win != null && win.getComputedStyle != null) {
cs = win.getComputedStyle(controlSec, null);
if (controlHour != null && controlHour.style != null && cs != null) {
controlHour.style.borderRightStyle = cs.getPropertyValue("border-right-style");
controlHour.style.borderRightWidth = cs.getPropertyValue("border-right-width");
controlHour.style.borderRightColor = cs.getPropertyValue("border-right-color");
controlHour.style.borderBottomRightRadius = cs.getPropertyValue("border-bottom-right-radius");
controlHour.style.borderTopRightRadius = cs.getPropertyValue("border-top-right-radius");
}
}
//controlSec.style.display = "none";
};
// }
hideMinSecFields("DURATIONFIELDHERE");
//hideMinSecFields("field2");
}