forked from wowthemesnet/mediumish-theme-jekyll
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.html
57 lines (49 loc) · 1.15 KB
/
test.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<html>
<head>
<title>Greeting Message</title>
<style>
#lbl {
font-family: monospace;
font-size: xx-large;
color: #626262;
padding: 5px;
border: 1px solid #ececec;
text-align: center;
line-height: 1.5;
height:85%
}
#date{
font-size:large;
}
body{
background-color: aliceblue;
}
</style>
</head>
<body>
<div id="lbl"></div>
</body>
<script>
var weekday = new Array(7);
weekday[0] = "Sunday";
weekday[1] = "Monday";
weekday[2] = "Tuesday";
weekday[3] = "Wednesday";
weekday[4] = "Thursday";
weekday[5] = "Friday";
weekday[6] = "Saturday";
var today = new Date();
var hrs = today.getHours();
var dayOfWeek = weekday[today.getDay()];
var date = dayOfWeek+" " + today.getDate() + "/" +(today.getMonth()+1) +'/'+today.getFullYear() ;
var greet;
if (hrs < 12)
greet = 'Good Morning ';
else if (hrs >= 12 && hrs <= 17)
greet = 'Good Afternoon ';
else if (hrs >= 17 && hrs <= 24)
greet = 'Good Evening ';
document.getElementById('lbl').innerHTML =
greet+=`<div id="date"> It's ${date}</div>`;
</script>
</html>