/
index.html
151 lines (136 loc) · 4.3 KB
/
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
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="author" content="Jan Suwart">
<title>Appointment Picker</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="example/demo.css">
<link rel="stylesheet" href="dist/appointment-picker.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/classlist/1.2.20171210/classList.min.js"></script>
<script src="https://code.jquery.com/jquery-3.2.1.min.js" integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4=" crossorigin="anonymous"></script>
<script src="src/appointment-picker.js"></script>
</head>
<body>
<article>
<h1>Appointment Picker</h1>
<p>A lightweight, accessible and customizable javascript timepicker.</p>
<p>
<a href="https://github.com/jannicz/appointment-picker">
<strong>Appointment-Picker source on Github</strong>
</a>
</p>
<h2>Default (no options, jQuery)</h2>
<p>
<label for="time-1">Time</label>
<input id="time-1" type="text" placeholder="hh:mm" aria-live="assertive" aria-label="Use up or down arrow keys to change time">
<pre>$.fn.appointmentPicker = function(options) {
this.appointmentPicker = new AppointmentPicker(this[0], options);
return this;
};
var $picker = $('#time-1').appointmentPicker();</pre>
</p>
<h2>Leading zero (large, jQuery)</h2>
<p>
<label for="time-2">Time</label>
<input id="time-2" type="text" value="8:15" placeholder="hh:mm" aria-live="assertive" aria-label="Use up or down arrow keys to change time">
<pre>
var $picker2 = $('#time-2').appointmentPicker({
title: 'Select an appointment',
interval: 15,
startTime: 8,
endTime: 14,
leadingZero: true,
large: true
});</pre>
</p>
<script type="text/javascript">
// To use appointmentPicker as jQuery plugin
$.fn.appointmentPicker = function(options) {
this.appointmentPicker = new AppointmentPicker(this[0], options);
return this;
};
var $picker = $('#time-1').appointmentPicker();
var $picker2 = $('#time-2').appointmentPicker({
title: 'Select an appointment',
interval: 15,
startTime: 8,
endTime: 14,
leadingZero: true,
large: true
});
</script>
<h2>Disabled array and min/maxTime (am/pm, vanillajs)</h2>
<p>
<label for="time-3">Time</label>
<input id="time-3" type="text" value="2:30 pm" placeholder="h:mm am" aria-live="assertive" aria-label="Use up or down arrow keys to change time">
<pre>
var picker = new AppointmentPicker(document.getElementById('time-3'), {
interval: 30,
mode: '12h',
minTime: 10,
maxTime: 21,
startTime: 09,
endTime: 23,
disabled: ['1:30 pm', '2:00 pm', '7:30 pm']
});</pre>
</p>
<h2 id="custom-time-format">Custom time format (large, am/pm, vanillajs)</h2>
<p>
<label for="time-4">Time</label>
<input id="time-4" type="text" value="12:00 pm" placeholder="h:mm am" aria-live="assertive" aria-label="Use up or down arrow keys to change time">
<pre>
new AppointmentPicker(document.getElementById('time-4'), {
interval: 15,
mode: '12h',
startTime: 11,
endTime: 16,
minTime: 11,
maxTime: 16,
disabled: ['3:00 pm', '3:30 pm'],
allowReset: false,
large: true,
timeFormat12: 'H.M AP.M.'
});</pre>
</p>
<script type="text/javascript">
var picker = new AppointmentPicker(document.getElementById('time-3'), {
interval: 30,
mode: '12h',
minTime: 10,
maxTime: 21,
startTime: 9,
endTime: 23,
disabled: ['1:30 pm', '2:00 pm', '7:30 pm']
});
new AppointmentPicker(document.getElementById('time-4'), {
interval: 15,
mode: '12h',
startTime: 11,
endTime: 16,
minTime: 11,
maxTime: 16,
disabled: ['3:00 pm', '3:30 pm'],
allowReset: false,
large: true,
timeFormat12: 'H.M AP.M.'
});
</script>
<p>
<h3>More Examples</h3>
<ul>
<li><a href="example/react.html">React Integration Example</a></li>
<li><a href="example/exposed-functions.html">Calling exposed functions</a></li>
<li><a href="example/form-submit.html">Form embed Example</a></li>
<li><a href="example/render-on-init.html">Rendering custom (markup) template</a></li>
</ul>
<h3>Tests</h3>
<ul>
<li><a href="tests/tests.html">Mocha Specs</a></li>
</ul>
</p>
<p>Report bugs or feature requests on <a href="https://github.com/jannicz/appointment-picker/issues">Github Issues</a></p>
<p><small>Copyright Jan Suwart, MIT license</small></p>
</article>
</body>
</html>