simple javascript clock for frontend
remove table from administration backend, styling with bootstrap for mobile compability
This commit is contained in:
parent
d68fa2c57e
commit
172437d378
3 changed files with 68 additions and 26 deletions
19
tycker/example-output-style/clock.js
Normal file
19
tycker/example-output-style/clock.js
Normal file
|
@ -0,0 +1,19 @@
|
|||
tday=new Array("Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag");
|
||||
tmonth=new Array("Januar","Februar","M%E4rz","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember");
|
||||
|
||||
function GetClock(){
|
||||
var d=new Date();
|
||||
var nday=d.getDay(),nmonth=d.getMonth(),ndate=d.getDate(),nyear=d.getYear(),nhour=d.getHours(),nmin=d.getMinutes(),nsec=d.getSeconds();
|
||||
|
||||
|
||||
if(nyear<1000) nyear+=1900;
|
||||
if(nmin<=9) nmin="0"+nmin;
|
||||
if(nsec<=9) nsec="0"+nsec;
|
||||
|
||||
document.getElementById('clockbox').innerHTML=""+tday[nday]+", "+ndate+". "+tmonth[nmonth]+" "+nyear+" <br/>"+nhour+":"+nmin+":"+nsec+"";
|
||||
}
|
||||
|
||||
window.onload=function(){
|
||||
GetClock();
|
||||
setInterval(GetClock,1000);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue