I have a Dashboard Map I am working on, I am creating a custom object to display the time in Hours : Minutes and have the dashboard set to refresh every 60 seconds so to keep the time up to date.
The issue I am having is the Dashboard will never refresh, though as soon as it is loaded it constantly shows the buffering/loading symbol on my browser.
Code for the Custom System Time:
function renderTime(offset) { var currentTime = new Date(); currentTime.setHours(currentTime.getHours() + offset); var diem = "AM"; var h = currentTime.getHours(); var m = currentTime.getMinutes(); //Defines AM/PM over 24 hour if (h == 0) { h = 12; } else if (h == 12){ diem = "PM"; } else if (h > 12, h < 24) { h = h - 12; diem = "PM"; } //Adds a 0 in front of single digit hours if (h < 10) { h = "0" + h; } //Adds a 0 in front of single digit minutes if (m < 10) { m = "0" + m; } //Output var myClock = document.getElementById("clockDisplay"); myClock.textContent = h + ":" + m + " " + diem; //Return tag to get values in PRTG - if omit, h and m will show as NaN return; } renderTime(+0).valueOf();
Note: I don't recall this issue happening before I started using this custom object, does JavaScript cause issues with Dashboards?
Add comment