Skip to content

Commit

Permalink
greeting fix
Browse files Browse the repository at this point in the history
  • Loading branch information
wishrohitv committed Jan 16, 2024
1 parent be3b97f commit 29ca26e
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,24 @@
function called() {
var time = new Date()
let timestamp = time.getHours()
console.log(timestamp)

var greting_user;
var greet_user;
if (timestamp >= 0 && timestamp < 12){
greting_user = "Good Morning🤩";
greet_user = "Good Morning🤩";
}
else if (timestamp >=12 && timestamp < 16){
greting_user = "Good AfterNoon🥰"
greet_user = "Good AfterNoon🥰";
}
else if (timestamp >=16 && timestamp < 19){
greting_user = "Good Evening😎"
greet_user = "Good Evening😎";

}
else if (timestamp >=24){
greting_user = "Good Night😴"
else if (timestamp <24){
greet_user = "Good Night😴";

}

document.getElementById("greetings").innerText = "Hello, "+greting_user
document.getElementById("greetings").innerText = "Hello, "+greet_user
}

// text color changer
Expand Down

0 comments on commit 29ca26e

Please sign in to comment.