forked from FezVrasta/bootstrap-material-datepicker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
271 lines (261 loc) · 7.9 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
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
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
<html>
<head>
<title>Bootstrap-Material DateTimePicker</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css" />
<link rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-material-design/0.5.10/css/bootstrap-material-design.min.css"/>
<link rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-material-design/0.5.10/css/ripples.min.css"/>
<link rel="stylesheet" href="./css/bootstrap-material-datetimepicker.css" />
<link href='http://fonts.googleapis.com/css?family=Roboto:400,500' rel='stylesheet' type='text/css'>
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<script src="https://code.jquery.com/jquery-1.12.3.min.js" integrity="sha256-aaODHAgvwQW1bFOGXMeX+pC4PZIPsvn2h1sArYOhgXQ=" crossorigin="anonymous"></script>
<script type="text/javascript" src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/js/bootstrap.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-material-design/0.5.10/js/ripples.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-material-design/0.5.10/js/material.min.js"></script>
<script type="text/javascript" src="https://rawgit.com/FezVrasta/bootstrap-material-design/master/dist/js/material.min.js"></script>
<script type="text/javascript" src="http://momentjs.com/downloads/moment-with-locales.min.js"></script>
<script type="text/javascript" src="./js/bootstrap-material-datetimepicker.js"></script>
<style>
body
{
padding-top: 70px;
font-family: 'Roboto', sans-serif;
}
h2
{
padding: 0 20px 10px 20px;
font-size: 20px;
font-weight: 400;
}
.form-control-wrapper
{
margin: 10px 20px;
}
code
{
padding: 10px;
background: #eee!important;
display: block;
color: #000;
}
code > p
{
font-weight: bold;
color: #000;
font-size: 1.5em;
}
@media(max-width: 300px)
{
.well { margin : 0}
}
</style>
<script>
(function(i, s, o, g, r, a, m) {
i['GoogleAnalyticsObject'] = r;
i[r] = i[r] || function() {
(i[r].q = i[r].q || []).push(arguments)
}, i[r].l = 1 * new Date();
a = s.createElement(o),
m = s.getElementsByTagName(o)[0];
a.async = 1;
a.src = g;
m.parentNode.insertBefore(a, m)
})(window, document, 'script', '//www.google-analytics.com/analytics.js', 'ga');
ga('create', 'UA-60343429-1', 'auto');
ga('send', 'pageview');
</script>
</head>
<body>
<div class="container well">
<div class="row">
<div class="col-md-6">
<h1>Bootstrap Material DatePicker</h1>
</div>
</div>
</div>
<div class="container well">
<div class="row">
<div class="col-md-6">
<h2>Date Picker</h2>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="form-control-wrapper">
<input type="text" id="date" class="form-control floating-label" placeholder="Date">
</div>
</div>
<div class="col-md-6">
<code>
<p>Code</p>
$('#date').bootstrapMaterialDatePicker({ weekStart : 0, time: false });
</code>
</div>
</div>
</div>
<div class="container well">
<div class="row">
<div class="col-md-6">
<h2>Time Picker</h2>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="form-control-wrapper">
<input type="text" id="time" class="form-control floating-label" placeholder="Time">
</div>
</div>
<div class="col-md-6">
<code>
<p>Code</p>
$('#time').bootstrapMaterialDatePicker({ date: false });
</code>
</div>
</div>
</div>
<div class="container well">
<div class="row">
<div class="col-md-6">
<h2>Date Time Picker</h2>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="form-control-wrapper">
<input type="text" id="date-format" class="form-control floating-label" placeholder="Begin Date Time">
</div>
</div>
<div class="col-md-6">
<code>
<p>Code</p>
$('#date-format').bootstrapMaterialDatePicker({ format : 'dddd DD MMMM YYYY - HH:mm' });
</code>
</div>
</div>
</div>
<div class="container well">
<div class="row">
<div class="col-md-6">
<h2>French Locales (Week starts at Monday)</h2>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="form-control-wrapper">
<input type="text" id="date-fr" class="form-control floating-label" value="18/03/2015 08:00" placeholder="Date de début">
</div>
</div>
<div class="col-md-6">
<code>
<p>Code</p>
$('#date-fr').bootstrapMaterialDatePicker({ format : 'DD/MM/YYYY HH:mm', lang : 'fr', weekStart : 1, cancelText : 'ANNULER' });
</code>
</div>
</div>
</div>
<div class="container well">
<div class="row">
<div class="col-md-6">
<h2>Min Date set</h2>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="form-control-wrapper">
<input type="text" id="min-date" class="form-control floating-label" placeholder="Start Date">
</div>
</div>
<div class="col-md-6">
<code>
<p>Code</p>
$('#min-date').bootstrapMaterialDatePicker({ format : 'DD/MM/YYYY HH:mm', minDate : new Date() });
</code>
</div>
</div>
</div>
<div class="container well">
<div class="row">
<div class="col-md-6">
<h2>Events</h2>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="row">
<div class="col-md-12">
<div class="form-control-wrapper">
<input type="text" id="date-start" class="form-control floating-label" placeholder="Start Date">
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="form-control-wrapper">
<input type="text" id="date-end" class="form-control floating-label" placeholder="End Date">
</div>
</div>
</div>
</div>
<div class="col-md-6">
<div class="row">
<div class="col-md-12">
<code>
<p>Code</p>
$('#date-end').bootstrapMaterialDatePicker({ weekStart : 0 });<br />
$('#date-start').bootstrapMaterialDatePicker({ weekStart : 0 }).on('change', function(e, date)<br />
{<br />
$('#date-end').bootstrapMaterialDatePicker('setMinDate', date);<br />
});
</code>
</div>
</div>
</div>
</div>
</div>
<script type="text/javascript">
$(document).ready(function()
{
$('#date').bootstrapMaterialDatePicker
({
time: false,
clearButton: true
});
$('#time').bootstrapMaterialDatePicker
({
date: false,
shortTime: false,
format: 'HH:mm'
});
$('#date-format').bootstrapMaterialDatePicker
({
format: 'dddd DD MMMM YYYY - HH:mm'
});
$('#date-fr').bootstrapMaterialDatePicker
({
format: 'DD/MM/YYYY HH:mm',
lang: 'fr',
weekStart: 1,
cancelText : 'ANNULER',
nowButton : true,
switchOnClick : true
});
$('#date-end').bootstrapMaterialDatePicker
({
weekStart: 0, format: 'DD/MM/YYYY HH:mm'
});
$('#date-start').bootstrapMaterialDatePicker
({
weekStart: 0, format: 'DD/MM/YYYY HH:mm', shortTime : true
}).on('change', function(e, date)
{
$('#date-end').bootstrapMaterialDatePicker('setMinDate', date);
});
$('#min-date').bootstrapMaterialDatePicker({ format : 'DD/MM/YYYY HH:mm', minDate : new Date() });
$.material.init()
});
</script>
</body>
</html>