-
Notifications
You must be signed in to change notification settings - Fork 1
/
example.html
58 lines (50 loc) · 1.57 KB
/
example.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
<!doctype html>
<html lang="pl">
<head>
<meta charset="utf-8">
<title>Opening Hours example</title>
<style>
.with-border {
border: 1px solid black;
padding: 10px;
max-width: 300px;
margin-bottom: 10px;
margin-top: 5px;
}
</style>
<!--[if lt IE 9]>
<script src="https://cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv.js"></script>
<![endif]-->
</head>
<body>
<h1>Opening hours example</h1>
Current status: <div class="with-border current-status-placeholder"></div>
We close/open: <div class="with-border closing-in-placeholder"></div>
<script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.21.0/moment-with-locales.min.js"></script>
<script src="opening-hours.js"></script>
<script>
var data = {
monday: [[8.30, 18.30]], // (beware! 8.30 means 08:30, using decimal part than is bigger than 59 will generate warning!
tuesday: [[8.30, 18.30]],
wednesday: [[6.30, 18.30]],
thursday: [
[6, 12.59],
[16.35, 16.39],
[18.30, 19.30]
],
friday: [[8.30, 18.30]],
saturday: [
[8.30, 12],
[14, 18]
],
sunday: [] //closed (optional, if entry for a day is empty, it's assumed that it is closed)
};
$('.current-status-placeholder').openingHours({
show: 'current-status',
hours: data
});
$('.closing-in-placeholder').openingHours({ show: 'closing-in', hours: data});
</script>
</body>
</html>