-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
44 lines (37 loc) · 1.3 KB
/
index.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Mini Calender using Js</title>
<link rel="stylesheet" href="stylec.css">
</head>
<body>
<div class="hero">
<div class="calender">
<div class="left">
<p id="date">01</p>
<p id="day">Sunday</p>
</div>
<div class="right">
<p id="month">January</p>
<p id="year">2020</p>
</div>
</div>
</div>
<script>
const date = document.getElementById("date");
const day = document.getElementById("day");
const month = document.getElementById("month");
const year= document.getElementById("year");
const today = new Date();
console.log(today);
const weekDays = ["Sunday","Monday", "Tuesday", "Wednesday", " Thursday", "Friday", "Saturday" ];
const allMonth =["January", "February", "March", "April", "May","June","July","August","September","October","November","December"];
date.innerHTML = (today.getDate()<10?"0":"") + today.getDate();
day.innerHTML = weekDays[today.getDay()];
month.innerHTML = allMonths[today.getMonth()];
year.innerHTML = today.getFullYear();
</script>
</body>
</html>