forked from oliversalzburg/angular-timepicker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdemo.html
More file actions
214 lines (197 loc) · 9.28 KB
/
demo.html
File metadata and controls
214 lines (197 loc) · 9.28 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
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
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
<!doctype html>
<html lang="en" ng-app="dnTimepicker">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Angular Timepicker Demo</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/bootstrap/3.1.0/css/bootstrap.min.css" />
<link rel="stylesheet" type="text/css" href="http://cdnjs.cloudflare.com/ajax/libs/SyntaxHighlighter/3.0.83/styles/shCore.css">
<link rel="stylesheet" type="text/css" href="http://cdnjs.cloudflare.com/ajax/libs/SyntaxHighlighter/3.0.83/styles/shThemeDefault.css">
<style type="text/css">
.bs-example {
position: relative;
padding: 45px 15px 15px;
margin: 0 -15px 15px;
background-color: #fafafa;
box-shadow: inset 0 3px 6px rgba(0,0,0,.05);
border-color: #e5e5e5 #eee #eee;
border-style: solid;
border-width: 1px 0;
}
.bs-example:after {
content: "Example";
position: absolute;
top: 15px;
left: 15px;
font-size: 12px;
font-weight: 700;
color: #bbb;
text-transform: uppercase;
letter-spacing: 1px;
}
.highlight {
padding: 9px 14px;
margin-bottom: 14px;
background-color: #f7f7f9;
border: 1px solid #e1e1e8;
border-radius: 4px;
}
.bs-example+.highlight {
margin: -15px -15px 15px;
border-radius: 0;
border-width: 0 0 1px;
}
@media (min-width: 768px) {
.bs-example {
margin-left: 0;
margin-right: 0;
background-color: #fff;
border-width: 1px;
border-color: #ddd;
border-radius: 4px 4px 0 0;
box-shadow: none;
}
.bs-example+.highlight {
margin-top: -16px;
margin-left: 0;
margin-right: 0;
border-width: 1px;
border-bottom-left-radius: 4px;
border-bottom-right-radius: 4px;
}
}
.dn-timepicker-popup {
max-height: 300px;
overflow-y: scroll;
}
</style>
</head>
<body>
<div class="container" ng-controller="Ctrl">
<header class="page-header">
<h1>Angular Timepicker Directive <small>Demo</small></h1>
</header>
<p class="lead">This directive creates a simple dropdown style timepicker, like the one used in Google Calendar.</p>
<h3>Basic</h3>
<p>The minimum requirement to start using the time picker is to add the dn-timepicker directive as an attribute to an input field, as well as specifying the model used using the ng-model attribute.</p>
<div class="bs-example">
<form class="form-horizontal" role="form">
<div class="form-group">
<label for="time1" class="col-sm-2 control-label">Select time</label>
<div class="col-sm-3">
<input type="text" class="form-control" id="time1" dn-timepicker ng-model="models.time1" />
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">Selected time</label>
<div class="col-sm-3">
<input type="text" class="form-control" ng-value="models.time1 | date:'h:mm a'" disabled />
</div>
</div>
</form>
</div>
<div class="highlight" ng-non-bindable>
<pre class="brush: xml"><input type="text" dn-timepicker ng-model="models.time" /></pre>
</div>
<h3>Range</h3>
<p>You can restrict input values to a predetermined range. The range values should follow the time format used.</p>
<div class="bs-example">
<form class="form-horizontal" role="form">
<div class="form-group">
<label for="time2" class="col-sm-2 control-label">Select time</label>
<div class="col-sm-3">
<input type="text" class="form-control" id="time2" dn-timepicker="h:mm a" ng-model="models.time2" min-time="9:00 am" max-time="5:00 pm" />
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">Selected time</label>
<div class="col-sm-3">
<input type="text" class="form-control" ng-value="models.time2 | date:'h:mm a'" disabled />
</div>
</div>
</form>
</div>
<div class="highlight" ng-non-bindable>
<pre class="brush: xml"><input type="text" dn-timepicker="h:mm a" ng-model="models.time" min-time="9:00 am" max-time="5:00 pm" /></pre>
</div>
<h3>Dynamic Range & Format</h3>
<p>You can change the format and range on-the-fly, should you need it, and the directive will take care of updating the view and the list.</p>
<div class="bs-example">
<form class="form-horizontal" role="form">
<div class="form-group">
<label for="time3" class="col-sm-2 control-label">Select time</label>
<div class="col-sm-3">
<input type="text" class="form-control" id="time3" dn-timepicker="{{models.format}}" ng-model="models.time3" min-time="{{models.minTime}}" max-time="{{models.maxTime}}" step="{{models.step}}" />
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">Selected time</label>
<div class="col-sm-3">
<input type="text" class="form-control" ng-value="models.time3 | date:'h:mm a'" disabled />
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">Format</label>
<div class="col-sm-3">
<input type="text" class="form-control" ng-model="models.format" />
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">Min time</label>
<div class="col-sm-3">
<input type="text" class="form-control" ng-model="models.minTime" />
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">Max time</label>
<div class="col-sm-3">
<input type="text" class="form-control" ng-model="models.maxTime" />
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">Step</label>
<div class="col-sm-3">
<input type="text" class="form-control" ng-model="models.step" />
</div>
</div>
</form>
</div>
<div class="highlight" ng-non-bindable>
<pre class="brush: js">// Model
$scope.models = {
time: new Date(),
format: 'h:mm a',
minTime: '9:00 am',
maxTime: '9:00 pm',
step: '15'
};</pre>
<pre class="brush: xml"><input type="text" dn-timepicker="{{models.format}}" ng-model="models.time" min-time="{{models.minTime}}" max-time="{{models.maxTime}}" step="{{models.step}}" /></pre>
</div>
</div>
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.0/angular.min.js"></script>
<script src="misc/test-lib/position.js"></script>
<script src="misc/test-lib/dateparser.js"></script>
<script src="angular.timepicker.js"></script>
<script>
function Ctrl($scope) {
$scope.models = {
time1: new Date(),
time2: new Date(),
time3: new Date(),
format: 'h:mm a',
minTime: '9:00 am',
maxTime: '9:00 pm',
step: '15'
};
}
</script>
<script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/SyntaxHighlighter/3.0.83/scripts/shCore.min.js"></script>
<script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/SyntaxHighlighter/3.0.83/scripts/shBrushXml.min.js"></script>
<script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/SyntaxHighlighter/3.0.83/scripts/shBrushJScript.min.js"></script>
<script type="text/javascript">
SyntaxHighlighter.all();
</script>
</body>
</html>