Adding a Clock Visualization to Your Dashboard (Video Tip)

Sometimes dashboards are built to go up on big-screen TVs/Wallboards around common office areas, production lines or command centers. Some people even keep dashboards constantly up on a side screen due to their real-time nature. You might consider putting a clock on these real-time dashboards in these cases. Here’s how you can do one easily in Dundas BI!

Here is the code I used:

// UPDATE THE DATE
var date = new Date();
var min = date.getMinutes();
if (min < 10)
{
	min = '0' + date.getMinutes();  
}
else 
{
	min = date.getMinutes();  
}
var sec = date.getSeconds();
if (sec < 10)
{
	sec = '0' + date.getSeconds();  
}
else 
{
	sec = date.getSeconds();  
}
var displayDate = (date.getMonth()+1) + '/' + date.getDate() + '/' + date.getFullYear() + '  ' + date.getHours() + ':' + min + ':' + sec; 
clockLabel.labelText = displayDate;

If you’d like to learn more, I’d recommend you go to my learning channel - Off the Charts (with Jeff).
https://www.dundas.com/resources/off-the-charts-tips-from-an-expert

3 Likes