OpenSlides/openslides/projector/static/javascript/clock.js
2013-11-06 14:58:30 +01:00

18 lines
456 B
JavaScript

function update_clock() {
var currentTime = projector.get_server_time()
var currentHours = currentTime.getHours();
var currentMinutes = currentTime.getMinutes();
currentHours = normalise(currentHours);
currentMinutes = normalise(currentMinutes);
$('#currentTime').html(currentHours + ':' + currentMinutes);
}
setInterval('update_clock()', 200);
function normalise(i) {
if (i < 10) {
i = "0" + i;
}
return i;
}