This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Realtime Clock
#16
Create a HTML widget. Put anything in the HTML input, the script below will replace it with date/time. Change widgetId to your actual widget ID.
Code:
const widgetId = 40 let interval Visu.on('widget-ready', widgetId, ({ widget }) => {   const el = widget.getEl()   el.classList.add('d-flex', 'align-items-center', 'justify-content-center')      const update = () => {     const date = new Date()     el.textContent = date.toLocaleString('en-GB', {       day: '2-digit',       month: '2-digit',       year: 'numeric',       hour: '2-digit',       minute: '2-digit',       second: '2-digit',       hour12: false     }).replace(',', '')   }      setInterval(update, 500)   update() }) Visu.on('widget-hide', widgetId, () => clearInterval(interval))
Reply


Messages In This Thread
Realtime Clock - by KoBra - 01.04.2026, 09:24
RE: Realtime Clock - by admin - 02.04.2026, 11:04
RE: Realtime Clock - by KoBra - 08.06.2026, 14:54
RE: Realtime Clock - by admin - 09.04.2026, 13:20
RE: Realtime Clock - by AlexLV - 09.04.2026, 17:28
RE: Realtime Clock - by Novodk - 09.04.2026, 19:36
RE: Realtime Clock - by admin - 10.04.2026, 06:59
RE: Realtime Clock - by cekca - 16.04.2026, 20:05
RE: Realtime Clock - by admin - 17.04.2026, 06:35
RE: Realtime Clock - by AlexLV - 17.04.2026, 10:55
RE: Realtime Clock - by admin - 17.04.2026, 11:04
RE: Realtime Clock - by AlexLV - 17.04.2026, 11:33
RE: Realtime Clock - by davidchispas - 08.06.2026, 10:26
RE: Realtime Clock - by admin - 08.06.2026, 10:53
RE: Realtime Clock - by admin - 09.06.2026, 09:26
RE: Visu bugs - by Novodk - 09.04.2026, 13:07

Forum Jump: