45 lines
994 B
HTML
45 lines
994 B
HTML
<!DOCTYPE html>
|
|
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<link rel="stylesheet" href="style.css" media="screen" charset="utf-8">
|
|
<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>
|