mirror of
https://github.com/fhem/fhem-mirror.git
synced 2024-11-22 16:09:49 +00:00
8d416232af
git-svn-id: https://svn.fhem.de/fhem/trunk@20777 2b470e98-0d58-463d-a4d8-8e2adae1ed80
25 lines
657 B
JavaScript
25 lines
657 B
JavaScript
function startTime() {
|
|
var today = new Date();
|
|
var h = today.getHours();
|
|
var m = today.getMinutes();
|
|
var d = today.getDate();
|
|
var mo = today.getMonth()+1;
|
|
var y = today.getFullYear();
|
|
var dofw =today.getDay();
|
|
var days = ['So', 'Mo', 'Di', 'Mi', 'Do', 'Fr', 'Sa'];
|
|
h = checkTime(h);
|
|
m = checkTime(m);
|
|
d = checkTime(d);
|
|
mo = checkTime(mo);
|
|
$('.doifclock').each(function(){
|
|
$(this).html(h + ":" + m + "  " + days[dofw] + " " + d + "." + mo + "." + y);
|
|
});
|
|
var t = setTimeout(startTime,1000);
|
|
|
|
}
|
|
function checkTime(i) {
|
|
if (i < 10) {i = "0" + i}; // add zero in front of numbers < 10
|
|
return i;
|
|
}
|
|
|
|
startTime(); |