Please Note This forum exists for community support for the Mango product family and the Radix IoT Platform. Although Radix IoT employees participate in this forum from time to time, there is no guarantee of a response to anything posted here, nor can Radix IoT, LLC guarantee the accuracy of any information expressed or conveyed. Specific project questions from customers with active support contracts are asked to send requests to support@radixiot.com.
Need to Display Hour(24) in dashboard, New and not sure where to start.
-
Need to Display Hour(24) in dashboard, New and not sure where to start.
-
You can create a meta point in Mango, set to alphanumeric, with the following script:
t=new Date(); h=t.getHours(); m=t.getMinutes(); s=t.getSeconds(); if(s<=9) s="0"+s; if(m<=9) m="0"+m; if(h<=9) h="0"+h; return h+":"+m+":"+s;
It will return the time in 24H format (including seconds, so adjust as needed).
You can then place your Meta Point onto your DGLux dashboard by binding it to an indicator. To do this just insert a text indicator and then drag the meta point from the sidebar onto the indicator.
-
@jeremyh said:
t=new Date();
h=t.getHours();
m=t.getMinutes();
s=t.getSeconds();
if(s<=9) s="0"+s;
if(m<=9) m="0"+m;
if(h<=9) h="0"+h;
return h+":"+m+":"+s;Jeremyh Thanks so much for the quick reply, It works great and will allow my shift changes to be at system time and in sync.
-
No problem.
I've just realised that crontab will not allow for updates faster than one minute, so you might like to just make it HH:MM and forget about the seconds.
You might also like to set the point properties to 'do not log' with a cache size of 1 as there is likely no benefit to storing these values on disk or more than one record in memory.
Cheers