-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
32 lines (31 loc) · 1.13 KB
/
Copy pathindex.html
File metadata and controls
32 lines (31 loc) · 1.13 KB
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
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<title>Birfdaygurl?</title>
<link rel="stylesheet" href="stylesheets/styles.css">
<link rel="stylesheet" href="stylesheets/pygment_trac.css">
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
</head>
<body>
<div class="wrapper">
<h1>Fyller pigen år?</h1>
<script>
today = new Date();
//console.log(today);
birthday = new Date(today.getFullYear(), 11, 21);
if (birthday < today) birthday.setFullYear(today.getFullYear() + 1);
//console.log(birthday);
difference = Math.round(Math.abs(birthday - today) / (24 * 60 * 60 * 1000));
if (today.getMonth() === 11 && today.getDate() === 21) {
document.write("<h2>Joffa fyller år!</h2>");
} else {
document.write(`<h2>Joffa fyller INTE år (det är ${difference} dagar kvar)!</h2>`);
}
</script>
</body>
</html>