-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
31 lines (29 loc) · 825 Bytes
/
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Calendar</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="calendar">
<p id="monthName"></p>
<p id="dayName"></p>
<p id="dayNumber"></p>
<p id="year"></p>
</div>
<script>
const lang = navigator.language;
let date = new Date();
let dayNumber = date.getDate();
let month = date.getMonth();
let dayName = date.toLocaleString(lang, {weekday: 'long'});
let monthName = date.toLocaleString(lang, {month: 'long'});
let year = date.getFullYear();
document.getElementById('monthName').innerHTML = monthName;
document.getElementById('dayName').innerHTML = dayName;
document.getElementById('dayNumber').innerHTML =dayNumber;
document.getElementById('year').innerHTML = year;
</script>
</body>
</html>