Initial commit
This commit is contained in:
commit
744e2063ae
22 changed files with 666 additions and 0 deletions
14
js/clock.js
Normal file
14
js/clock.js
Normal file
|
@ -0,0 +1,14 @@
|
|||
function updateTime() {
|
||||
const now = new Date(),
|
||||
hours = now.getHours(),
|
||||
minutes = now.getMinutes(),
|
||||
day = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"][now.getDay()],
|
||||
date = now.getDate(),
|
||||
month = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"][now.getMonth()],
|
||||
year = now.getFullYear();
|
||||
|
||||
$("#time-label").textContent = ((hours < 10 ? "0" : "") + hours) + ":" + ((minutes < 10 ? "0" : "") + minutes);
|
||||
$("#date-label").textContent = day + " " + date + ", " + month + " " + year;
|
||||
}
|
||||
|
||||
setInterval(updateTime, 500);
|
Loading…
Add table
Add a link
Reference in a new issue