index.js

PHOTO EMBED

Sat Oct 02 2021 06:16:19 GMT+0000 (UTC)

Saved by @delitescere #lowjs #hotwire #thymeleaf #html

const zeroPad = n => `${n < 10 ? '0' : ''}${n}`;

function updateClock() {
  const now = new Date();
  const hh = zeroPad(now.getUTCHours());
  const mm = zeroPad(now.getUTCMinutes());
  const ss = zeroPad(now.getUTCSeconds());
  let clock = document.getElementById('clock');
  clock.innerHTML = `${hh}:${mm}:${ss}&nbsp;UTC`;
  clock.setAttribute('datetime', now.toISOString());
}

// #ProgressiveEnhancement
document.getElementById('status_frame_load').click();

updateClock();
setInterval(updateClock, 1000);
content_copyCOPY

https://bitbucket.org/delitescere/status.gallery/src/main/src/main/resources/static/scripts/index.js