27 lines
725 B
JavaScript
27 lines
725 B
JavaScript
(function () {
|
|
const dateNode = document.getElementById('kb-login-date');
|
|
const timeNode = document.getElementById('kb-login-time');
|
|
|
|
if (!dateNode || !timeNode) {
|
|
return;
|
|
}
|
|
|
|
const renderClock = () => {
|
|
const now = new Date();
|
|
|
|
dateNode.textContent = new Intl.DateTimeFormat(document.documentElement.lang || 'de', {
|
|
weekday: 'long',
|
|
month: 'long',
|
|
day: 'numeric',
|
|
}).format(now);
|
|
|
|
timeNode.textContent = new Intl.DateTimeFormat(document.documentElement.lang || 'de', {
|
|
hour: 'numeric',
|
|
minute: '2-digit',
|
|
}).format(now);
|
|
};
|
|
|
|
renderClock();
|
|
window.setInterval(renderClock, 1000);
|
|
}());
|