datbarCheckJS/erdatbarenaaben.dk

50 lines
998 B
Plaintext
Raw Normal View History

2016-01-04 01:39:27 +00:00
<!DOCTYPE html>
<head>
<meta charset="utf-8">
2016-02-03 23:13:34 +00:00
<link rel="stylesheet" href="style.css" media="screen" charset="utf-8">
2016-01-04 01:39:27 +00:00
<script>
function datbarCheck()
{
var d = new Date();
var n = d.getDay();
var t = d.getTime();
var hours = d.getHours();
var minutes = d.getMinutes();
var weekday = new Array(7);
weekday[0]= "Søndag";
weekday[1] = "Mandag";
weekday[2] = "Tirsdag";
weekday[3] = "Onsdag"
weekday[4] = "Torsdag";
weekday[5] = "Fredag";
weekday[6] = "Lørdag";
var answer = document.getElementById("answer")
if (n == 5)
{
answer.innerHTML = "Baren skulle være åben fra klokken 15:00!";
}
else
{
answer.innerHTML = "Baren er desværre ikke åben, da det er " + weekday[n] + " og klokken er " + hours + ":" + minutes;
}
}
</script>
</head>
<body onload="datbarCheck();">
<div id="print"></div>
<div id="answer"></div>
</body>
</html>