Skip to content

Commit

Permalink
Finally founf the problem with the months and added comments
Browse files Browse the repository at this point in the history
  • Loading branch information
HastDu authored Oct 24, 2024
1 parent beb26e0 commit 1faa5b3
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions public/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const period = document.getElementById("period");
const month = months[mont + 1]
const period = document.getElementById("period"); //for later ;)

var months = ['January','Febuary','March','April','May','June','July','August','September','October','November','December']

setInterval(() => {
Expand All @@ -10,6 +10,7 @@ setInterval(() => {
const minutes = now.getMinutes();
const seconds = now.getSeconds();

document.getElementById("period").innerHTML = `Today is: ${month} ${day}, ${hours}:${minutes}:${seconds}`;
document.getElementById("title").innerHTML = `${month} ${day}`;
}, 250);
const month = months[mont + 1] //selects the month from the array
document.getElementById("period").innerHTML = `Today is: ${month} ${day}, ${hours}:${minutes}:${seconds}`; //changes the H1
document.getElementById("title").innerHTML = `${month} ${day}`; //changes title
}, 250); //updates display every 1/4 of a second

0 comments on commit 1faa5b3

Please sign in to comment.