datatables.net-datetime 1.4.1 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/css/dataTables.dateTime.scss +123 -15
- package/datatables.net-datetime.1.4.0.nupkg +0 -0
- package/dist/dataTables.dateTime.css +92 -18
- package/dist/dataTables.dateTime.js +37 -8
- package/dist/dataTables.dateTime.min.css +1 -1
- package/dist/dataTables.dateTime.min.js +2 -2
- package/dist/dataTables.dateTime.min.mjs +2 -2
- package/dist/dataTables.dateTime.mjs +37 -8
- package/docs/api/display().xml +29 -0
- package/examples/index.xml +1 -0
- package/examples/initialisation/buttons.xml +18 -7
- package/examples/initialisation/datetime.xml +12 -4
- package/examples/initialisation/dayjs.xml +16 -4
- package/examples/initialisation/hidden.xml +10 -4
- package/examples/initialisation/i18n.xml +48 -9
- package/examples/initialisation/index.xml +1 -0
- package/examples/initialisation/luxon.xml +13 -4
- package/examples/initialisation/moment.xml +12 -4
- package/examples/initialisation/simple.xml +10 -4
- package/examples/integration/datatables.xml +69 -34
- package/examples/integration/form.xml +38 -19
- package/js/dataTables.dateTime.js +37 -8
- package/nuget.nuspec +1 -1
- package/package.json +1 -1
- package/test/api/dateTime.destroy().js +4 -4
- package/test/api/dateTime.hide().js +5 -5
- package/test/options/dateTime.firstDay.js +2 -2
- package/test/options/dateTime.init.js +4 -4
- package/examples/initialisation/jquery.xml +0 -28
|
@@ -7,8 +7,9 @@ div.dt-datetime {
|
|
|
7
7
|
z-index: 2050;
|
|
8
8
|
border: 1px solid #ccc;
|
|
9
9
|
box-shadow: 0 5px 15px -5px rgba(0,0,0,.5);
|
|
10
|
-
padding:
|
|
10
|
+
padding: 6px 20px;
|
|
11
11
|
width: 275px;
|
|
12
|
+
border-radius: 5px;
|
|
12
13
|
|
|
13
14
|
&.inline {
|
|
14
15
|
position: relative;
|
|
@@ -195,9 +196,7 @@ div.dt-datetime {
|
|
|
195
196
|
|
|
196
197
|
|
|
197
198
|
div.dt-datetime-iconLeft,
|
|
198
|
-
div.dt-datetime-iconRight
|
|
199
|
-
div.dt-datetime-iconUp,
|
|
200
|
-
div.dt-datetime-iconDown {
|
|
199
|
+
div.dt-datetime-iconRight {
|
|
201
200
|
width: 30px;
|
|
202
201
|
height: 30px;
|
|
203
202
|
background-position: center;
|
|
@@ -205,6 +204,7 @@ div.dt-datetime {
|
|
|
205
204
|
opacity: 0.3;
|
|
206
205
|
overflow: hidden;
|
|
207
206
|
box-sizing: border-box;
|
|
207
|
+
border: 1px solid transparent;
|
|
208
208
|
|
|
209
209
|
&:hover {
|
|
210
210
|
border: 1px solid #ccc;
|
|
@@ -227,24 +227,44 @@ div.dt-datetime {
|
|
|
227
227
|
position: absolute;
|
|
228
228
|
top: 5px;
|
|
229
229
|
left: 5px;
|
|
230
|
-
|
|
230
|
+
|
|
231
|
+
button {
|
|
232
|
+
position: relative;
|
|
233
|
+
z-index: 1;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
&:after {
|
|
237
|
+
position: absolute;
|
|
238
|
+
top: 7px;
|
|
239
|
+
left: 10px;
|
|
240
|
+
display: block;
|
|
241
|
+
content: "";
|
|
242
|
+
border-top: 7px solid transparent;
|
|
243
|
+
border-right: 7px solid black;
|
|
244
|
+
border-bottom: 7px solid transparent;
|
|
245
|
+
}
|
|
231
246
|
}
|
|
232
247
|
|
|
233
248
|
div.dt-datetime-iconRight {
|
|
234
249
|
position: absolute;
|
|
235
250
|
top: 5px;
|
|
236
251
|
right: 5px;
|
|
237
|
-
background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAeCAYAAAAsEj5rAAAAU0lEQVR42u3VOwoAMAgE0dwfAnNjU26bYkBCFGwfiL9VVWoO+BJ4Gf3gtsEKKoFBNTCoCAYVwaAiGNQGMUHMkjGbgjk2mIONuXo0nC8XnCf1JXgArVIZAQh5TKYAAAAASUVORK5CYII=');
|
|
238
|
-
}
|
|
239
252
|
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
253
|
+
button {
|
|
254
|
+
position: relative;
|
|
255
|
+
z-index: 1;
|
|
256
|
+
}
|
|
244
257
|
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
258
|
+
&:after {
|
|
259
|
+
position: absolute;
|
|
260
|
+
top: 7px;
|
|
261
|
+
left: 12px;
|
|
262
|
+
display: block;
|
|
263
|
+
content: "";
|
|
264
|
+
border-top: 7px solid transparent;
|
|
265
|
+
border-left: 7px solid black;
|
|
266
|
+
border-bottom: 7px solid transparent;
|
|
267
|
+
}
|
|
248
268
|
}
|
|
249
269
|
}
|
|
250
270
|
|
|
@@ -256,4 +276,92 @@ div.dt-datetime-error {
|
|
|
256
276
|
line-height: 1.25em;
|
|
257
277
|
text-align: center;
|
|
258
278
|
color: #b11f1f;
|
|
259
|
-
}
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
|
|
282
|
+
html.dark {
|
|
283
|
+
input.dt-datetime {
|
|
284
|
+
color-scheme: dark;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
div.dt-datetime {
|
|
288
|
+
border: 1px solid rgb(89, 91, 94);
|
|
289
|
+
background-color: rgb(33, 37, 41);
|
|
290
|
+
box-shadow: 3px 4px 10px 1px rgba(0, 0, 0, 0.8);
|
|
291
|
+
|
|
292
|
+
table {
|
|
293
|
+
th {
|
|
294
|
+
color: #ccc;
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
td {
|
|
298
|
+
color: #eee;
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
td.selectable {
|
|
302
|
+
background: rgb(55, 60, 65);
|
|
303
|
+
|
|
304
|
+
&.disabled {
|
|
305
|
+
color: #aaa;
|
|
306
|
+
background: rgb(23, 27, 31);
|
|
307
|
+
|
|
308
|
+
button:hover {
|
|
309
|
+
color: #aaa;
|
|
310
|
+
background: rgb(23, 27, 31);
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
&.now {
|
|
315
|
+
background: rgb(75, 80, 85);
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
&.selected button {
|
|
319
|
+
background: rgb(110, 168, 254);
|
|
320
|
+
color: black;
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
button:hover {
|
|
324
|
+
background: #ff8000;
|
|
325
|
+
color: black;
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
div.dt-datetime-label {
|
|
331
|
+
&:hover {
|
|
332
|
+
border: 1px solid transparent;
|
|
333
|
+
background-color: rgba(255, 255, 255, 0.1);
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
div.dt-datetime-iconLeft,
|
|
338
|
+
div.dt-datetime-iconRight,
|
|
339
|
+
div.dt-datetime-iconUp,
|
|
340
|
+
div.dt-datetime-iconDown {
|
|
341
|
+
&:hover {
|
|
342
|
+
border: 1px solid transparent;
|
|
343
|
+
background-color: rgba(255, 255, 255, 0.1);
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
div.dt-datetime-iconLeft {
|
|
348
|
+
&:after {
|
|
349
|
+
border-right-color: white;
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
div.dt-datetime-iconRight {
|
|
354
|
+
&:after {
|
|
355
|
+
border-left-color: white;
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
select {
|
|
360
|
+
color-scheme: dark;
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
div.dt-datetime-error {
|
|
365
|
+
color: #b11f1f;
|
|
366
|
+
}
|
|
367
|
+
}
|
|
Binary file
|
|
@@ -4,8 +4,9 @@ div.dt-datetime {
|
|
|
4
4
|
z-index: 2050;
|
|
5
5
|
border: 1px solid #ccc;
|
|
6
6
|
box-shadow: 0 5px 15px -5px rgba(0, 0, 0, 0.5);
|
|
7
|
-
padding:
|
|
7
|
+
padding: 6px 20px;
|
|
8
8
|
width: 275px;
|
|
9
|
+
border-radius: 5px;
|
|
9
10
|
}
|
|
10
11
|
div.dt-datetime.inline {
|
|
11
12
|
position: relative;
|
|
@@ -155,9 +156,7 @@ div.dt-datetime div.dt-datetime-time div.dt-datetime-timeblock {
|
|
|
155
156
|
vertical-align: middle;
|
|
156
157
|
}
|
|
157
158
|
div.dt-datetime div.dt-datetime-iconLeft,
|
|
158
|
-
div.dt-datetime div.dt-datetime-iconRight
|
|
159
|
-
div.dt-datetime div.dt-datetime-iconUp,
|
|
160
|
-
div.dt-datetime div.dt-datetime-iconDown {
|
|
159
|
+
div.dt-datetime div.dt-datetime-iconRight {
|
|
161
160
|
width: 30px;
|
|
162
161
|
height: 30px;
|
|
163
162
|
background-position: center;
|
|
@@ -165,20 +164,17 @@ div.dt-datetime div.dt-datetime-iconDown {
|
|
|
165
164
|
opacity: 0.3;
|
|
166
165
|
overflow: hidden;
|
|
167
166
|
box-sizing: border-box;
|
|
167
|
+
border: 1px solid transparent;
|
|
168
168
|
}
|
|
169
169
|
div.dt-datetime div.dt-datetime-iconLeft:hover,
|
|
170
|
-
div.dt-datetime div.dt-datetime-iconRight:hover
|
|
171
|
-
div.dt-datetime div.dt-datetime-iconUp:hover,
|
|
172
|
-
div.dt-datetime div.dt-datetime-iconDown:hover {
|
|
170
|
+
div.dt-datetime div.dt-datetime-iconRight:hover {
|
|
173
171
|
border: 1px solid #ccc;
|
|
174
172
|
border-radius: 2px;
|
|
175
173
|
background-color: #f0f0f0;
|
|
176
174
|
opacity: 0.6;
|
|
177
175
|
}
|
|
178
176
|
div.dt-datetime div.dt-datetime-iconLeft button,
|
|
179
|
-
div.dt-datetime div.dt-datetime-iconRight button
|
|
180
|
-
div.dt-datetime div.dt-datetime-iconUp button,
|
|
181
|
-
div.dt-datetime div.dt-datetime-iconDown button {
|
|
177
|
+
div.dt-datetime div.dt-datetime-iconRight button {
|
|
182
178
|
border: none;
|
|
183
179
|
background: transparent;
|
|
184
180
|
text-indent: 30px;
|
|
@@ -190,21 +186,39 @@ div.dt-datetime div.dt-datetime-iconLeft {
|
|
|
190
186
|
position: absolute;
|
|
191
187
|
top: 5px;
|
|
192
188
|
left: 5px;
|
|
193
|
-
|
|
189
|
+
}
|
|
190
|
+
div.dt-datetime div.dt-datetime-iconLeft button {
|
|
191
|
+
position: relative;
|
|
192
|
+
z-index: 1;
|
|
193
|
+
}
|
|
194
|
+
div.dt-datetime div.dt-datetime-iconLeft:after {
|
|
195
|
+
position: absolute;
|
|
196
|
+
top: 7px;
|
|
197
|
+
left: 10px;
|
|
198
|
+
display: block;
|
|
199
|
+
content: "";
|
|
200
|
+
border-top: 7px solid transparent;
|
|
201
|
+
border-right: 7px solid black;
|
|
202
|
+
border-bottom: 7px solid transparent;
|
|
194
203
|
}
|
|
195
204
|
div.dt-datetime div.dt-datetime-iconRight {
|
|
196
205
|
position: absolute;
|
|
197
206
|
top: 5px;
|
|
198
207
|
right: 5px;
|
|
199
|
-
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAeCAYAAAAsEj5rAAAAU0lEQVR42u3VOwoAMAgE0dwfAnNjU26bYkBCFGwfiL9VVWoO+BJ4Gf3gtsEKKoFBNTCoCAYVwaAiGNQGMUHMkjGbgjk2mIONuXo0nC8XnCf1JXgArVIZAQh5TKYAAAAASUVORK5CYII=");
|
|
200
208
|
}
|
|
201
|
-
div.dt-datetime div.dt-datetime-
|
|
202
|
-
|
|
203
|
-
|
|
209
|
+
div.dt-datetime div.dt-datetime-iconRight button {
|
|
210
|
+
position: relative;
|
|
211
|
+
z-index: 1;
|
|
204
212
|
}
|
|
205
|
-
div.dt-datetime div.dt-datetime-
|
|
206
|
-
|
|
207
|
-
|
|
213
|
+
div.dt-datetime div.dt-datetime-iconRight:after {
|
|
214
|
+
position: absolute;
|
|
215
|
+
top: 7px;
|
|
216
|
+
left: 12px;
|
|
217
|
+
display: block;
|
|
218
|
+
content: "";
|
|
219
|
+
border-top: 7px solid transparent;
|
|
220
|
+
border-left: 7px solid black;
|
|
221
|
+
border-bottom: 7px solid transparent;
|
|
208
222
|
}
|
|
209
223
|
|
|
210
224
|
div.dt-datetime-error {
|
|
@@ -215,4 +229,64 @@ div.dt-datetime-error {
|
|
|
215
229
|
line-height: 1.25em;
|
|
216
230
|
text-align: center;
|
|
217
231
|
color: #b11f1f;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
html.dark input.dt-datetime {
|
|
235
|
+
color-scheme: dark;
|
|
236
|
+
}
|
|
237
|
+
html.dark div.dt-datetime {
|
|
238
|
+
border: 1px solid #595b5e;
|
|
239
|
+
background-color: #212529;
|
|
240
|
+
box-shadow: 3px 4px 10px 1px rgba(0, 0, 0, 0.8);
|
|
241
|
+
}
|
|
242
|
+
html.dark div.dt-datetime table th {
|
|
243
|
+
color: #ccc;
|
|
244
|
+
}
|
|
245
|
+
html.dark div.dt-datetime table td {
|
|
246
|
+
color: #eee;
|
|
247
|
+
}
|
|
248
|
+
html.dark div.dt-datetime table td.selectable {
|
|
249
|
+
background: #373c41;
|
|
250
|
+
}
|
|
251
|
+
html.dark div.dt-datetime table td.selectable.disabled {
|
|
252
|
+
color: #aaa;
|
|
253
|
+
background: #171b1f;
|
|
254
|
+
}
|
|
255
|
+
html.dark div.dt-datetime table td.selectable.disabled button:hover {
|
|
256
|
+
color: #aaa;
|
|
257
|
+
background: #171b1f;
|
|
258
|
+
}
|
|
259
|
+
html.dark div.dt-datetime table td.selectable.now {
|
|
260
|
+
background: #4b5055;
|
|
261
|
+
}
|
|
262
|
+
html.dark div.dt-datetime table td.selectable.selected button {
|
|
263
|
+
background: #6ea8fe;
|
|
264
|
+
color: black;
|
|
265
|
+
}
|
|
266
|
+
html.dark div.dt-datetime table td.selectable button:hover {
|
|
267
|
+
background: #ff8000;
|
|
268
|
+
color: black;
|
|
269
|
+
}
|
|
270
|
+
html.dark div.dt-datetime div.dt-datetime-label:hover {
|
|
271
|
+
border: 1px solid transparent;
|
|
272
|
+
background-color: rgba(255, 255, 255, 0.1);
|
|
273
|
+
}
|
|
274
|
+
html.dark div.dt-datetime div.dt-datetime-iconLeft:hover,
|
|
275
|
+
html.dark div.dt-datetime div.dt-datetime-iconRight:hover,
|
|
276
|
+
html.dark div.dt-datetime div.dt-datetime-iconUp:hover,
|
|
277
|
+
html.dark div.dt-datetime div.dt-datetime-iconDown:hover {
|
|
278
|
+
border: 1px solid transparent;
|
|
279
|
+
background-color: rgba(255, 255, 255, 0.1);
|
|
280
|
+
}
|
|
281
|
+
html.dark div.dt-datetime div.dt-datetime-iconLeft:after {
|
|
282
|
+
border-right-color: white;
|
|
283
|
+
}
|
|
284
|
+
html.dark div.dt-datetime div.dt-datetime-iconRight:after {
|
|
285
|
+
border-left-color: white;
|
|
286
|
+
}
|
|
287
|
+
html.dark div.dt-datetime select {
|
|
288
|
+
color-scheme: dark;
|
|
289
|
+
}
|
|
290
|
+
html.dark div.dt-datetime-error {
|
|
291
|
+
color: #b11f1f;
|
|
218
292
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! DateTime picker for DataTables.net v1.
|
|
1
|
+
/*! DateTime picker for DataTables.net v1.5.0
|
|
2
2
|
*
|
|
3
3
|
* © SpryMedia Ltd, all rights reserved.
|
|
4
4
|
* License: MIT datatables.net/license/mit
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
|
|
49
49
|
/**
|
|
50
50
|
* @summary DateTime picker for DataTables.net
|
|
51
|
-
* @version 1.
|
|
51
|
+
* @version 1.5.0
|
|
52
52
|
* @file dataTables.dateTime.js
|
|
53
53
|
* @author SpryMedia Ltd
|
|
54
54
|
* @contact www.datatables.net/contact
|
|
@@ -197,6 +197,8 @@ var DateTime = function ( input, opts ) {
|
|
|
197
197
|
.append( this.dom.buttons )
|
|
198
198
|
.append( this.dom.calendar );
|
|
199
199
|
|
|
200
|
+
this.dom.input.addClass('dt-datetime');
|
|
201
|
+
|
|
200
202
|
this._constructor();
|
|
201
203
|
};
|
|
202
204
|
|
|
@@ -212,10 +214,33 @@ $.extend( DateTime.prototype, {
|
|
|
212
214
|
this._hide(true);
|
|
213
215
|
this.dom.container.off().empty();
|
|
214
216
|
this.dom.input
|
|
217
|
+
.removeClass('dt-datetime')
|
|
215
218
|
.removeAttr('autocomplete')
|
|
216
219
|
.off('.datetime');
|
|
217
220
|
},
|
|
218
221
|
|
|
222
|
+
display: function (year, month) {
|
|
223
|
+
if (year !== undefined) {
|
|
224
|
+
this.s.display.setUTCFullYear(year);
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
if (month !== undefined) {
|
|
228
|
+
this.s.display.setUTCMonth(month - 1);
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
if (year !== undefined || month !== undefined) {
|
|
232
|
+
this._setTitle();
|
|
233
|
+
this._setCalander();
|
|
234
|
+
|
|
235
|
+
return this;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
return {
|
|
239
|
+
month: this.s.display.getUTCMonth() + 1,
|
|
240
|
+
year: this.s.display.getUTCFullYear()
|
|
241
|
+
};
|
|
242
|
+
},
|
|
243
|
+
|
|
219
244
|
errorMsg: function ( msg ) {
|
|
220
245
|
var error = this.dom.error;
|
|
221
246
|
|
|
@@ -1551,21 +1576,25 @@ $.extend( DateTime.prototype, {
|
|
|
1551
1576
|
_writeOutput: function ( focus ) {
|
|
1552
1577
|
var date = this.s.d;
|
|
1553
1578
|
var out = '';
|
|
1579
|
+
var input = this.dom.input;
|
|
1554
1580
|
|
|
1555
1581
|
if (date) {
|
|
1556
1582
|
out = this._convert(date, null, this.c.format);
|
|
1557
1583
|
}
|
|
1558
1584
|
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1585
|
+
input.val( out );
|
|
1586
|
+
|
|
1587
|
+
// Create a DOM synthetic event. Can't use $().trigger() as
|
|
1588
|
+
// that doesn't actually trigger non-jQuery event listeners
|
|
1589
|
+
var event = new Event('change', {bubbles: true});
|
|
1590
|
+
input[0].dispatchEvent(event);
|
|
1562
1591
|
|
|
1563
|
-
if (
|
|
1592
|
+
if ( input.attr('type') === 'hidden' ) {
|
|
1564
1593
|
this.val(out, false);
|
|
1565
1594
|
}
|
|
1566
1595
|
|
|
1567
1596
|
if ( focus ) {
|
|
1568
|
-
|
|
1597
|
+
input.focus();
|
|
1569
1598
|
}
|
|
1570
1599
|
}
|
|
1571
1600
|
} );
|
|
@@ -1655,7 +1684,7 @@ DateTime.defaults = {
|
|
|
1655
1684
|
yearRange: 25
|
|
1656
1685
|
};
|
|
1657
1686
|
|
|
1658
|
-
DateTime.version = '1.
|
|
1687
|
+
DateTime.version = '1.5.0';
|
|
1659
1688
|
|
|
1660
1689
|
/**
|
|
1661
1690
|
* CommonJS factory function pass through. Matches DataTables.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
div.dt-datetime{position:absolute;background-color:white;z-index:2050;border:1px solid #ccc;box-shadow:0 5px 15px -5px rgba(0, 0, 0, 0.5);padding:
|
|
1
|
+
div.dt-datetime{position:absolute;background-color:white;z-index:2050;border:1px solid #ccc;box-shadow:0 5px 15px -5px rgba(0, 0, 0, 0.5);padding:6px 20px;width:275px;border-radius:5px}div.dt-datetime.inline{position:relative;box-shadow:none}div.dt-datetime div.dt-datetime-title{text-align:center;padding:5px 0px 3px}div.dt-datetime div.dt-datetime-buttons{text-align:center}div.dt-datetime div.dt-datetime-buttons a{display:inline-block;padding:0 .5em .5em .5em;margin:0;font-size:.9em}div.dt-datetime div.dt-datetime-buttons a:hover{text-decoration:underline}div.dt-datetime table{border-spacing:0;margin:12px 0;width:100%}div.dt-datetime table.dt-datetime-table-nospace{margin-top:-12px}div.dt-datetime table th{font-size:.8em;color:#777;font-weight:normal;width:14.285714286%;padding:0 0 4px 0;text-align:center}div.dt-datetime table td{font-size:.9em;color:#444;padding:0}div.dt-datetime table td.selectable{text-align:center;background:#f5f5f5}div.dt-datetime table td.selectable.disabled{color:#aaa;background:white}div.dt-datetime table td.selectable.disabled button:hover{color:#aaa;background:white}div.dt-datetime table td.selectable.now{background-color:#ddd}div.dt-datetime table td.selectable.now button{font-weight:bold}div.dt-datetime table td.selectable.selected button{background:#4e6ca3;color:white;border-radius:2px}div.dt-datetime table td.selectable button:hover{background:#ff8000;color:white;border-radius:2px}div.dt-datetime table td.dt-datetime-week{font-size:.7em}div.dt-datetime table button{width:100%;box-sizing:border-box;border:none;background:transparent;font-size:inherit;color:inherit;text-align:center;padding:4px 0;cursor:pointer;margin:0}div.dt-datetime table button span{display:inline-block;min-width:14px;text-align:right}div.dt-datetime table.weekNumber th{width:12.5%}div.dt-datetime div.dt-datetime-calendar table{margin-top:0}div.dt-datetime div.dt-datetime-label{position:relative;display:inline-block;height:30px;padding:5px 6px;border:1px solid transparent;box-sizing:border-box;cursor:pointer}div.dt-datetime div.dt-datetime-label:hover{border:1px solid #ddd;border-radius:2px;background-color:#f5f5f5}div.dt-datetime div.dt-datetime-label select{position:absolute;top:6px;left:0;cursor:pointer;opacity:0}div.dt-datetime.horizontal{width:550px}div.dt-datetime.horizontal div.dt-datetime-date,div.dt-datetime.horizontal div.dt-datetime-time{width:48%}div.dt-datetime.horizontal div.dt-datetime-time{margin-left:4%}div.dt-datetime div.dt-datetime-date{position:relative;float:left;width:100%}div.dt-datetime div.dt-datetime-time{position:relative;float:left;width:100%;text-align:center}div.dt-datetime div.dt-datetime-time>span{vertical-align:middle}div.dt-datetime div.dt-datetime-time th{text-align:left}div.dt-datetime div.dt-datetime-time div.dt-datetime-timeblock{display:inline-block;vertical-align:middle}div.dt-datetime div.dt-datetime-iconLeft,div.dt-datetime div.dt-datetime-iconRight{width:30px;height:30px;background-position:center;background-repeat:no-repeat;opacity:.3;overflow:hidden;box-sizing:border-box;border:1px solid transparent}div.dt-datetime div.dt-datetime-iconLeft:hover,div.dt-datetime div.dt-datetime-iconRight:hover{border:1px solid #ccc;border-radius:2px;background-color:#f0f0f0;opacity:.6}div.dt-datetime div.dt-datetime-iconLeft button,div.dt-datetime div.dt-datetime-iconRight button{border:none;background:transparent;text-indent:30px;height:100%;width:100%;cursor:pointer}div.dt-datetime div.dt-datetime-iconLeft{position:absolute;top:5px;left:5px}div.dt-datetime div.dt-datetime-iconLeft button{position:relative;z-index:1}div.dt-datetime div.dt-datetime-iconLeft:after{position:absolute;top:7px;left:10px;display:block;content:"";border-top:7px solid transparent;border-right:7px solid black;border-bottom:7px solid transparent}div.dt-datetime div.dt-datetime-iconRight{position:absolute;top:5px;right:5px}div.dt-datetime div.dt-datetime-iconRight button{position:relative;z-index:1}div.dt-datetime div.dt-datetime-iconRight:after{position:absolute;top:7px;left:12px;display:block;content:"";border-top:7px solid transparent;border-left:7px solid black;border-bottom:7px solid transparent}div.dt-datetime-error{clear:both;padding:0 1em;max-width:240px;font-size:11px;line-height:1.25em;text-align:center;color:#b11f1f}html.dark input.dt-datetime{color-scheme:dark}html.dark div.dt-datetime{border:1px solid #595b5e;background-color:#212529;box-shadow:3px 4px 10px 1px rgba(0, 0, 0, 0.8)}html.dark div.dt-datetime table th{color:#ccc}html.dark div.dt-datetime table td{color:#eee}html.dark div.dt-datetime table td.selectable{background:#373c41}html.dark div.dt-datetime table td.selectable.disabled{color:#aaa;background:#171b1f}html.dark div.dt-datetime table td.selectable.disabled button:hover{color:#aaa;background:#171b1f}html.dark div.dt-datetime table td.selectable.now{background:#4b5055}html.dark div.dt-datetime table td.selectable.selected button{background:#6ea8fe;color:black}html.dark div.dt-datetime table td.selectable button:hover{background:#ff8000;color:black}html.dark div.dt-datetime div.dt-datetime-label:hover{border:1px solid transparent;background-color:rgba(255, 255, 255, 0.1)}html.dark div.dt-datetime div.dt-datetime-iconLeft:hover,html.dark div.dt-datetime div.dt-datetime-iconRight:hover,html.dark div.dt-datetime div.dt-datetime-iconUp:hover,html.dark div.dt-datetime div.dt-datetime-iconDown:hover{border:1px solid transparent;background-color:rgba(255, 255, 255, 0.1)}html.dark div.dt-datetime div.dt-datetime-iconLeft:after{border-right-color:white}html.dark div.dt-datetime div.dt-datetime-iconRight:after{border-left-color:white}html.dark div.dt-datetime select{color-scheme:dark}html.dark div.dt-datetime-error{color:#b11f1f}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/*! DateTime picker for DataTables.net v1.
|
|
1
|
+
/*! DateTime picker for DataTables.net v1.5.0
|
|
2
2
|
*
|
|
3
3
|
* © SpryMedia Ltd, all rights reserved.
|
|
4
4
|
* License: MIT datatables.net/license/mit
|
|
5
5
|
*/
|
|
6
|
-
!function(s){var i;"function"==typeof define&&define.amd?define(["jquery"],function(t){return s(t,window,document)}):"object"==typeof exports?(i=require("jquery"),"undefined"==typeof window?module.exports=function(t,e){return t=t||window,e=e||i(t),s(e,t,t.document)}:module.exports=s(i,window,window.document)):s(jQuery,window,document)}(function(C,o,i,n){"use strict";function a(t,e){if(a.factory(t,e))return a;if(void 0===r&&(r=o.moment||o.dayjs||o.luxon||null),this.c=C.extend(!0,{},a.defaults,e),e=this.c.classPrefix,this.c.i18n,!r&&"YYYY-MM-DD"!==this.c.format)throw"DateTime: Without momentjs, dayjs or luxon only the format 'YYYY-MM-DD' can be used";"string"==typeof this.c.minDate&&(this.c.minDate=new Date(this.c.minDate)),"string"==typeof this.c.maxDate&&(this.c.maxDate=new Date(this.c.maxDate));var s=C('<div class="'+e+'"><div class="'+e+'-date"><div class="'+e+'-title"><div class="'+e+'-iconLeft"><button type="button"></button></div><div class="'+e+'-iconRight"><button type="button"></button></div><div class="'+e+'-label"><span></span><select class="'+e+'-month"></select></div><div class="'+e+'-label"><span></span><select class="'+e+'-year"></select></div></div><div class="'+e+'-buttons"><a class="'+e+'-clear"></a><a class="'+e+'-today"></a></div><div class="'+e+'-calendar"></div></div><div class="'+e+'-time"><div class="'+e+'-hours"></div><div class="'+e+'-minutes"></div><div class="'+e+'-seconds"></div></div><div class="'+e+'-error"></div></div>');this.dom={container:s,date:s.find("."+e+"-date"),title:s.find("."+e+"-title"),calendar:s.find("."+e+"-calendar"),time:s.find("."+e+"-time"),error:s.find("."+e+"-error"),buttons:s.find("."+e+"-buttons"),clear:s.find("."+e+"-clear"),today:s.find("."+e+"-today"),previous:s.find("."+e+"-iconLeft"),next:s.find("."+e+"-iconRight"),input:C(t)},this.s={d:null,display:null,minutesRange:null,secondsRange:null,namespace:"dateime-"+a._instance++,parts:{date:null!==this.c.format.match(/[YMD]|L(?!T)|l/),time:null!==this.c.format.match(/[Hhm]|LT|LTS/),seconds:-1!==this.c.format.indexOf("s"),hours12:null!==this.c.format.match(/[haA]/)}},this.dom.container.append(this.dom.date).append(this.dom.time).append(this.dom.error),this.dom.date.append(this.dom.title).append(this.dom.buttons).append(this.dom.calendar),this._constructor()}var r;return C.extend(a.prototype,{destroy:function(){this._hide(!0),this.dom.container.off().empty(),this.dom.input.removeAttr("autocomplete").off(".datetime")},errorMsg:function(t){var e=this.dom.error;return t?e.html(t):e.empty(),this},hide:function(){return this._hide(),this},max:function(t){return this.c.maxDate="string"==typeof t?new Date(t):t,this._optionsTitle(),this._setCalander(),this},min:function(t){return this.c.minDate="string"==typeof t?new Date(t):t,this._optionsTitle(),this._setCalander(),this},owns:function(t){return 0<C(t).parents().filter(this.dom.container).length},val:function(t,e){return t===n?this.s.d:(t instanceof Date?this.s.d=this._dateToUtc(t):null===t||""===t?this.s.d=null:"--now"===t?this.s.d=this._dateToUtc(new Date):"string"==typeof t&&(this.s.d=this._dateToUtc(this._convert(t,this.c.format,null))),!e&&e!==n||(this.s.d?this._writeOutput():this.dom.input.val(t)),this.s.display=this.s.d?new Date(this.s.d.toString()):new Date,this.s.display.setUTCDate(1),this._setTitle(),this._setCalander(),this._setTime(),this)},valFormat:function(t,e){return e?(this.val(this._convert(e,t,null)),this):this._convert(this.val(),null,t)},_constructor:function(){function a(){var t=o.dom.input.val();t!==e&&(o.c.onChange.call(o,t,o.s.d,o.dom.input),e=t)}var o=this,r=this.c.classPrefix,e=this.dom.input.val();this.s.parts.date||this.dom.date.css("display","none"),this.s.parts.time||this.dom.time.css("display","none"),this.s.parts.seconds||(this.dom.time.children("div."+r+"-seconds").remove(),this.dom.time.children("span").eq(1).remove()),this.c.buttons.clear||this.dom.clear.css("display","none"),this.c.buttons.today||this.dom.today.css("display","none"),this._optionsTitle(),C(i).on("i18n.dt",function(t,e){e.oLanguage.datetime&&(C.extend(!0,o.c.i18n,e.oLanguage.datetime),o._optionsTitle())}),"hidden"===this.dom.input.attr("type")&&(this.dom.container.addClass("inline"),this.c.attachTo="input",this.val(this.dom.input.val(),!1),this._show()),e&&this.val(e,!1),this.dom.input.attr("autocomplete","off").on("focus.datetime click.datetime",function(){o.dom.container.is(":visible")||o.dom.input.is(":disabled")||(o.val(o.dom.input.val(),!1),o._show())}).on("keyup.datetime",function(){o.dom.container.is(":visible")&&o.val(o.dom.input.val(),!1)}),this.dom.container.on("change","select",function(){var t,e,s=C(this),i=s.val();s.hasClass(r+"-month")?(o._correctMonth(o.s.display,i),o._setTitle(),o._setCalander()):s.hasClass(r+"-year")?(o.s.display.setUTCFullYear(i),o._setTitle(),o._setCalander()):s.hasClass(r+"-hours")||s.hasClass(r+"-ampm")?(o.s.parts.hours12?(t=+C(o.dom.container).find("."+r+"-hours").val(),e="pm"===C(o.dom.container).find("."+r+"-ampm").val(),o.s.d.setUTCHours(12!=t||e?e&&12!=t?12+t:t:0)):o.s.d.setUTCHours(i),o._setTime(),o._writeOutput(!0),a()):s.hasClass(r+"-minutes")?(o.s.d.setUTCMinutes(i),o._setTime(),o._writeOutput(!0),a()):s.hasClass(r+"-seconds")&&(o.s.d.setSeconds(i),o._setTime(),o._writeOutput(!0),a()),o.dom.input.focus(),o._position()}).on("click",function(t){var e=o.s.d,s="span"===t.target.nodeName.toLowerCase()?t.target.parentNode:t.target,i=s.nodeName.toLowerCase();if("select"!==i)if(t.stopPropagation(),"a"===i&&(t.preventDefault(),C(s).hasClass(r+"-clear")?(o.s.d=null,o.dom.input.val(""),o._writeOutput(),o._setCalander(),o._setTime(),a()):C(s).hasClass(r+"-today")&&(o.s.display=new Date,o._setTitle(),o._setCalander())),"button"===i){t=C(s),i=t.parent();if(i.hasClass("disabled")&&!i.hasClass("range"))t.blur();else if(i.hasClass(r+"-iconLeft"))o.s.display.setUTCMonth(o.s.display.getUTCMonth()-1),o._setTitle(),o._setCalander(),o.dom.input.focus();else if(i.hasClass(r+"-iconRight"))o._correctMonth(o.s.display,o.s.display.getUTCMonth()+1),o._setTitle(),o._setCalander(),o.dom.input.focus();else{if(t.parents("."+r+"-time").length){var s=t.data("value"),n=t.data("unit"),e=o._needValue();if("minutes"===n){if(i.hasClass("disabled")&&i.hasClass("range"))return o.s.minutesRange=s,void o._setTime();o.s.minutesRange=null}if("seconds"===n){if(i.hasClass("disabled")&&i.hasClass("range"))return o.s.secondsRange=s,void o._setTime();o.s.secondsRange=null}if("am"===s){if(!(12<=e.getUTCHours()))return;s=e.getUTCHours()-12}else if("pm"===s){if(!(e.getUTCHours()<12))return;s=e.getUTCHours()+12}e["hours"===n?"setUTCHours":"minutes"===n?"setUTCMinutes":"setSeconds"](s),o._setCalander(),o._setTime(),o._writeOutput(!0)}else(e=o._needValue()).setUTCDate(1),e.setUTCFullYear(t.data("year")),e.setUTCMonth(t.data("month")),e.setUTCDate(t.data("day")),o._writeOutput(!0),o.s.parts.time?(o._setCalander(),o._setTime()):setTimeout(function(){o._hide()},10);a()}}else o.dom.input.focus()})},_compareDates:function(t,e){return this._isLuxon()?r.DateTime.fromJSDate(t).toUTC().toISODate()===r.DateTime.fromJSDate(e).toUTC().toISODate():this._dateToUtcString(t)===this._dateToUtcString(e)},_convert:function(t,e,s){var i;return t&&(r?this._isLuxon()?(i=t instanceof Date?r.DateTime.fromJSDate(t).toUTC():r.DateTime.fromFormat(t,e)).isValid?s?i.toFormat(s):i.toJSDate():null:(i=t instanceof Date?r.utc(t,n,this.c.locale,this.c.strict):r(t,e,this.c.locale,this.c.strict)).isValid()?s?i.format(s):i.toDate():null:!e&&!s||e&&s?t:e?(i=t.match(/(\d{4})\-(\d{2})\-(\d{2})/))?new Date(i[1],i[2]-1,i[3]):null:t.getUTCFullYear()+"-"+this._pad(t.getUTCMonth()+1)+"-"+this._pad(t.getUTCDate()))},_correctMonth:function(t,e){var s=this._daysInMonth(t.getUTCFullYear(),e),i=t.getUTCDate()>s;t.setUTCMonth(e),i&&(t.setUTCDate(s),t.setUTCMonth(e))},_daysInMonth:function(t,e){return[31,t%4==0&&(t%100!=0||t%400==0)?29:28,31,30,31,30,31,31,30,31,30,31][e]},_dateToUtc:function(t){return t&&new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds()))},_dateToUtcString:function(t){return this._isLuxon()?r.DateTime.fromJSDate(t).toUTC().toISODate():t.getUTCFullYear()+"-"+this._pad(t.getUTCMonth()+1)+"-"+this._pad(t.getUTCDate())},_hide:function(t){!t&&"hidden"===this.dom.input.attr("type")||(t=this.s.namespace,this.dom.container.detach(),C(o).off("."+t),C(i).off("keydown."+t),C("div.dataTables_scrollBody").off("scroll."+t),C("div.DTE_Body_Content").off("scroll."+t),C("body").off("click."+t),C(this.dom.input[0].offsetParent).off("."+t))},_hours24To12:function(t){return 0===t?12:12<t?t-12:t},_htmlDay:function(t){var e,s;return t.empty?'<td class="empty"></td>':(e=["selectable"],s=this.c.classPrefix,t.disabled&&e.push("disabled"),t.today&&e.push("now"),t.selected&&e.push("selected"),'<td data-day="'+t.day+'" class="'+e.join(" ")+'"><button class="'+s+"-button "+s+'-day" type="button" data-year="'+t.year+'" data-month="'+t.month+'" data-day="'+t.day+'"><span>'+t.day+"</span></button></td>")},_htmlMonth:function(t,e){for(var s=this._dateToUtc(new Date),i=this._daysInMonth(t,e),n=new Date(Date.UTC(t,e,1)).getUTCDay(),a=[],o=[],r=(0<this.c.firstDay&&(n-=this.c.firstDay)<0&&(n+=7),i+n),d=r;7<d;)d-=7;r+=7-d;var l=this.c.minDate,h=this.c.maxDate;l&&(l.setUTCHours(0),l.setUTCMinutes(0),l.setSeconds(0)),h&&(h.setUTCHours(23),h.setUTCMinutes(59),h.setSeconds(59));for(var c=0,u=0;c<r;c++){var m=new Date(Date.UTC(t,e,c-n+1)),f=!!this.s.d&&this._compareDates(m,this.s.d),p=this._compareDates(m,s),y=c<n||i+n<=c,T=l&&m<l||h&&h<m,_=this.c.disableDays,f={day:c-n+1,month:e,year:t,selected:f,today:p,disabled:T=Array.isArray(_)&&-1!==C.inArray(m.getUTCDay(),_)||"function"==typeof _&&!0===_(m)?!0:T,empty:y};o.push(this._htmlDay(f)),7==++u&&(this.c.showWeekNumber&&o.unshift(this._htmlWeekOfYear(c-n,e,t)),a.push("<tr>"+o.join("")+"</tr>"),o=[],u=0)}var v,D=this.c.classPrefix,g=D+"-table";return this.c.showWeekNumber&&(g+=" weekNumber"),l&&(v=l>=new Date(Date.UTC(t,e,1,0,0,0)),this.dom.title.find("div."+D+"-iconLeft").css("display",v?"none":"block")),h&&(v=h<new Date(Date.UTC(t,e+1,1,0,0,0)),this.dom.title.find("div."+D+"-iconRight").css("display",v?"none":"block")),'<table class="'+g+'"><thead>'+this._htmlMonthHead()+"</thead><tbody>"+a.join("")+"</tbody></table>"},_htmlMonthHead:function(){var t=[],e=this.c.firstDay,s=this.c.i18n;this.c.showWeekNumber&&t.push("<th></th>");for(var i=0;i<7;i++)t.push("<th>"+function(t){for(t+=e;7<=t;)t-=7;return s.weekdays[t]}(i)+"</th>");return t.join("")},_htmlWeekOfYear:function(t,e,s){e=new Date(s,e,t,0,0,0,0),e.setDate(e.getDate()+4-(e.getDay()||7)),t=new Date(s,0,1),s=Math.ceil(((e-t)/864e5+1)/7);return'<td class="'+this.c.classPrefix+'-week">'+s+"</td>"},_isLuxon:function(){return!!(r&&r.DateTime&&r.Duration&&r.Settings)},_needValue:function(){return this.s.d||(this.s.d=this._dateToUtc(new Date),this.s.parts.time)||(this.s.d.setUTCHours(0),this.s.d.setUTCMinutes(0),this.s.d.setSeconds(0),this.s.d.setMilliseconds(0)),this.s.d},_options:function(t,e,s){s=s||e;var i=this.dom.container.find("select."+this.c.classPrefix+"-"+t);i.empty();for(var n=0,a=e.length;n<a;n++)i.append('<option value="'+e[n]+'">'+s[n]+"</option>")},_optionSet:function(t,e){var t=this.dom.container.find("select."+this.c.classPrefix+"-"+t),s=t.parent().children("span"),e=(t.val(e),t.find("option:selected"));s.html(0!==e.length?e.text():this.c.i18n.unknown)},_optionsTime:function(n,a,o,r,t){var e,d=this.c.classPrefix,s=this.dom.container.find("div."+d+"-"+n),i=12===a?function(t){return t}:this._pad,l=(d=this.c.classPrefix)+"-table",h=this.c.i18n;if(s.length){var c="",u=10,m=function(t,e,s){12===a&&"number"==typeof t&&(12<=o&&(t+=12),12==t?t=0:24==t&&(t=12));var i=o===t||"am"===t&&o<12||"pm"===t&&12<=o?"selected":"";return"number"==typeof t&&r&&-1===C.inArray(t,r)&&(i+=" disabled"),s&&(i+=" "+s),'<td class="selectable '+i+'"><button class="'+d+"-button "+d+'-day" type="button" data-unit="'+n+'" data-value="'+t+'"><span>'+e+"</span></button></td>"};if(12===a){for(c+="<tr>",e=1;e<=6;e++)c+=m(e,i(e));for(c=(c+=m("am",h.amPm[0]))+"</tr>"+"<tr>",e=7;e<=12;e++)c+=m(e,i(e));c=c+m("pm",h.amPm[1])+"</tr>",u=7}else{if(24===a)for(var f=0,p=0;p<4;p++){for(c+="<tr>",e=0;e<6;e++)c+=m(f,i(f)),f++;c+="</tr>"}else{for(c+="<tr>",p=0;p<60;p+=10)c+=m(p,i(p),"range");var c=c+"</tr>"+('</tbody></thead><table class="'+l+" "+l+'-nospace"><tbody>'),y=null!==t?t:-1===o?0:10*Math.floor(o/10);for(c+="<tr>",p=y+1;p<y+10;p++)c+=m(p,i(p));c+="</tr>"}u=6}s.empty().append('<table class="'+l+'"><thead><tr><th colspan="'+u+'">'+h[n]+"</th></tr></thead><tbody>"+c+"</tbody></table>")}},_optionsTitle:function(){var t=this.c.i18n,e=this.c.minDate,s=this.c.maxDate,e=e?e.getFullYear():null,s=s?s.getFullYear():null,e=null!==e?e:(new Date).getFullYear()-this.c.yearRange,s=null!==s?s:(new Date).getFullYear()+this.c.yearRange;this._options("month",this._range(0,11),t.months),this._options("year",this._range(e,s)),this.dom.today.text(t.today).text(t.today),this.dom.clear.text(t.clear).text(t.clear),this.dom.previous.attr("title",t.previous).children("button").text(t.previous),this.dom.next.attr("title",t.next).children("button").text(t.next)},_pad:function(t){return t<10?"0"+t:t},_position:function(){var t,e,s,i="input"===this.c.attachTo?this.dom.input.position():this.dom.input.offset(),n=this.dom.container,a=this.dom.input.outerHeight();n.hasClass("inline")?n.insertAfter(this.dom.input):(this.s.parts.date&&this.s.parts.time&&550<C(o).width()?n.addClass("horizontal"):n.removeClass("horizontal"),"input"===this.c.attachTo?n.css({top:i.top+a,left:i.left}).insertAfter(this.dom.input):n.css({top:i.top+a,left:i.left}).appendTo("body"),t=n.outerHeight(),e=n.outerWidth(),s=C(o).scrollTop(),i.top+a+t-s>C(o).height()&&(a=i.top-t,n.css("top",a<0?0:a)),e+i.left>C(o).width()&&(s=C(o).width()-e,"input"===this.c.attachTo&&(s-=C(n).offsetParent().offset().left),n.css("left",s<0?0:s)))},_range:function(t,e,s){var i=[];s=s||1;for(var n=t;n<=e;n+=s)i.push(n);return i},_setCalander:function(){this.s.display&&this.dom.calendar.empty().append(this._htmlMonth(this.s.display.getUTCFullYear(),this.s.display.getUTCMonth()))},_setTitle:function(){this._optionSet("month",this.s.display.getUTCMonth()),this._optionSet("year",this.s.display.getUTCFullYear())},_setTime:function(){function t(t){return e.c[t+"Available"]||e._range(0,59,e.c[t+"Increment"])}var e=this,s=this.s.d,i=null,n=null!=(i=this._isLuxon()?r.DateTime.fromJSDate(s).toUTC():i)?i.hour:s?s.getUTCHours():-1;this._optionsTime("hours",this.s.parts.hours12?12:24,n,this.c.hoursAvailable),this._optionsTime("minutes",60,null!=i?i.minute:s?s.getUTCMinutes():-1,t("minutes"),this.s.minutesRange),this._optionsTime("seconds",60,null!=i?i.second:s?s.getSeconds():-1,t("seconds"),this.s.secondsRange)},_show:function(){var e=this,t=this.s.namespace,s=(this._position(),C(o).on("scroll."+t+" resize."+t,function(){e._position()}),C("div.DTE_Body_Content").on("scroll."+t,function(){e._position()}),C("div.dataTables_scrollBody").on("scroll."+t,function(){e._position()}),this.dom.input[0].offsetParent);s!==i.body&&C(s).on("scroll."+t,function(){e._position()}),C(i).on("keydown."+t,function(t){9!==t.keyCode&&27!==t.keyCode&&13!==t.keyCode||e._hide()}),setTimeout(function(){C("body").on("click."+t,function(t){C(t.target).parents().filter(e.dom.container).length||t.target===e.dom.input[0]||e._hide()})},10)},_writeOutput:function(t){var e=this.s.d,s="";e&&(s=this._convert(e,null,this.c.format)),this.dom.input.val(s).trigger("change",{write:e}),"hidden"===this.dom.input.attr("type")&&this.val(s,!1),t&&this.dom.input.focus()}}),a.use=function(t){r=t},a._instance=0,a.type="DateTime",a.defaults={attachTo:"body",buttons:{clear:!1,today:!1},classPrefix:"dt-datetime",disableDays:null,firstDay:1,format:"YYYY-MM-DD",hoursAvailable:null,i18n:{clear:"Clear",previous:"Previous",next:"Next",months:["January","February","March","April","May","June","July","August","September","October","November","December"],weekdays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],amPm:["am","pm"],hours:"Hour",minutes:"Minute",seconds:"Second",unknown:"-",today:"Today"},maxDate:null,minDate:null,minutesAvailable:null,minutesIncrement:1,strict:!0,locale:"en",onChange:function(){},secondsAvailable:null,secondsIncrement:1,showWeekNumber:!1,yearRange:25},a.version="1.4.1",a.factory=function(t,e){var s=!1;return t&&t.document&&(i=(o=t).document),e&&e.fn&&e.fn.jquery&&(C=e,s=!0),s},o.DateTime||(o.DateTime=a),o.DataTable&&(o.DataTable.DateTime=a),C.fn.dtDateTime=function(t){return this.each(function(){new a(this,t)})},C.fn.dataTable&&(C.fn.dataTable.DateTime=a,C.fn.DataTable.DateTime=a,C.fn.dataTable.Editor)&&(C.fn.dataTable.Editor.DateTime=a),a});
|
|
6
|
+
!function(s){var i;"function"==typeof define&&define.amd?define(["jquery"],function(t){return s(t,window,document)}):"object"==typeof exports?(i=require("jquery"),"undefined"==typeof window?module.exports=function(t,e){return t=t||window,e=e||i(t),s(e,t,t.document)}:module.exports=s(i,window,window.document)):s(jQuery,window,document)}(function(g,o,i,n){"use strict";function a(t,e){if(a.factory(t,e))return a;if(void 0===r&&(r=o.moment||o.dayjs||o.luxon||null),this.c=g.extend(!0,{},a.defaults,e),e=this.c.classPrefix,this.c.i18n,!r&&"YYYY-MM-DD"!==this.c.format)throw"DateTime: Without momentjs, dayjs or luxon only the format 'YYYY-MM-DD' can be used";"string"==typeof this.c.minDate&&(this.c.minDate=new Date(this.c.minDate)),"string"==typeof this.c.maxDate&&(this.c.maxDate=new Date(this.c.maxDate));var s=g('<div class="'+e+'"><div class="'+e+'-date"><div class="'+e+'-title"><div class="'+e+'-iconLeft"><button type="button"></button></div><div class="'+e+'-iconRight"><button type="button"></button></div><div class="'+e+'-label"><span></span><select class="'+e+'-month"></select></div><div class="'+e+'-label"><span></span><select class="'+e+'-year"></select></div></div><div class="'+e+'-buttons"><a class="'+e+'-clear"></a><a class="'+e+'-today"></a></div><div class="'+e+'-calendar"></div></div><div class="'+e+'-time"><div class="'+e+'-hours"></div><div class="'+e+'-minutes"></div><div class="'+e+'-seconds"></div></div><div class="'+e+'-error"></div></div>');this.dom={container:s,date:s.find("."+e+"-date"),title:s.find("."+e+"-title"),calendar:s.find("."+e+"-calendar"),time:s.find("."+e+"-time"),error:s.find("."+e+"-error"),buttons:s.find("."+e+"-buttons"),clear:s.find("."+e+"-clear"),today:s.find("."+e+"-today"),previous:s.find("."+e+"-iconLeft"),next:s.find("."+e+"-iconRight"),input:g(t)},this.s={d:null,display:null,minutesRange:null,secondsRange:null,namespace:"dateime-"+a._instance++,parts:{date:null!==this.c.format.match(/[YMD]|L(?!T)|l/),time:null!==this.c.format.match(/[Hhm]|LT|LTS/),seconds:-1!==this.c.format.indexOf("s"),hours12:null!==this.c.format.match(/[haA]/)}},this.dom.container.append(this.dom.date).append(this.dom.time).append(this.dom.error),this.dom.date.append(this.dom.title).append(this.dom.buttons).append(this.dom.calendar),this.dom.input.addClass("dt-datetime"),this._constructor()}var r;return g.extend(a.prototype,{destroy:function(){this._hide(!0),this.dom.container.off().empty(),this.dom.input.removeClass("dt-datetime").removeAttr("autocomplete").off(".datetime")},display:function(t,e){return t!==n&&this.s.display.setUTCFullYear(t),e!==n&&this.s.display.setUTCMonth(e-1),t!==n||e!==n?(this._setTitle(),this._setCalander(),this):{month:this.s.display.getUTCMonth()+1,year:this.s.display.getUTCFullYear()}},errorMsg:function(t){var e=this.dom.error;return t?e.html(t):e.empty(),this},hide:function(){return this._hide(),this},max:function(t){return this.c.maxDate="string"==typeof t?new Date(t):t,this._optionsTitle(),this._setCalander(),this},min:function(t){return this.c.minDate="string"==typeof t?new Date(t):t,this._optionsTitle(),this._setCalander(),this},owns:function(t){return 0<g(t).parents().filter(this.dom.container).length},val:function(t,e){return t===n?this.s.d:(t instanceof Date?this.s.d=this._dateToUtc(t):null===t||""===t?this.s.d=null:"--now"===t?this.s.d=this._dateToUtc(new Date):"string"==typeof t&&(this.s.d=this._dateToUtc(this._convert(t,this.c.format,null))),!e&&e!==n||(this.s.d?this._writeOutput():this.dom.input.val(t)),this.s.display=this.s.d?new Date(this.s.d.toString()):new Date,this.s.display.setUTCDate(1),this._setTitle(),this._setCalander(),this._setTime(),this)},valFormat:function(t,e){return e?(this.val(this._convert(e,t,null)),this):this._convert(this.val(),null,t)},_constructor:function(){function a(){var t=o.dom.input.val();t!==e&&(o.c.onChange.call(o,t,o.s.d,o.dom.input),e=t)}var o=this,r=this.c.classPrefix,e=this.dom.input.val();this.s.parts.date||this.dom.date.css("display","none"),this.s.parts.time||this.dom.time.css("display","none"),this.s.parts.seconds||(this.dom.time.children("div."+r+"-seconds").remove(),this.dom.time.children("span").eq(1).remove()),this.c.buttons.clear||this.dom.clear.css("display","none"),this.c.buttons.today||this.dom.today.css("display","none"),this._optionsTitle(),g(i).on("i18n.dt",function(t,e){e.oLanguage.datetime&&(g.extend(!0,o.c.i18n,e.oLanguage.datetime),o._optionsTitle())}),"hidden"===this.dom.input.attr("type")&&(this.dom.container.addClass("inline"),this.c.attachTo="input",this.val(this.dom.input.val(),!1),this._show()),e&&this.val(e,!1),this.dom.input.attr("autocomplete","off").on("focus.datetime click.datetime",function(){o.dom.container.is(":visible")||o.dom.input.is(":disabled")||(o.val(o.dom.input.val(),!1),o._show())}).on("keyup.datetime",function(){o.dom.container.is(":visible")&&o.val(o.dom.input.val(),!1)}),this.dom.container.on("change","select",function(){var t,e,s=g(this),i=s.val();s.hasClass(r+"-month")?(o._correctMonth(o.s.display,i),o._setTitle(),o._setCalander()):s.hasClass(r+"-year")?(o.s.display.setUTCFullYear(i),o._setTitle(),o._setCalander()):s.hasClass(r+"-hours")||s.hasClass(r+"-ampm")?(o.s.parts.hours12?(t=+g(o.dom.container).find("."+r+"-hours").val(),e="pm"===g(o.dom.container).find("."+r+"-ampm").val(),o.s.d.setUTCHours(12!=t||e?e&&12!=t?12+t:t:0)):o.s.d.setUTCHours(i),o._setTime(),o._writeOutput(!0),a()):s.hasClass(r+"-minutes")?(o.s.d.setUTCMinutes(i),o._setTime(),o._writeOutput(!0),a()):s.hasClass(r+"-seconds")&&(o.s.d.setSeconds(i),o._setTime(),o._writeOutput(!0),a()),o.dom.input.focus(),o._position()}).on("click",function(t){var e=o.s.d,s="span"===t.target.nodeName.toLowerCase()?t.target.parentNode:t.target,i=s.nodeName.toLowerCase();if("select"!==i)if(t.stopPropagation(),"a"===i&&(t.preventDefault(),g(s).hasClass(r+"-clear")?(o.s.d=null,o.dom.input.val(""),o._writeOutput(),o._setCalander(),o._setTime(),a()):g(s).hasClass(r+"-today")&&(o.s.display=new Date,o._setTitle(),o._setCalander())),"button"===i){t=g(s),i=t.parent();if(i.hasClass("disabled")&&!i.hasClass("range"))t.blur();else if(i.hasClass(r+"-iconLeft"))o.s.display.setUTCMonth(o.s.display.getUTCMonth()-1),o._setTitle(),o._setCalander(),o.dom.input.focus();else if(i.hasClass(r+"-iconRight"))o._correctMonth(o.s.display,o.s.display.getUTCMonth()+1),o._setTitle(),o._setCalander(),o.dom.input.focus();else{if(t.parents("."+r+"-time").length){var s=t.data("value"),n=t.data("unit"),e=o._needValue();if("minutes"===n){if(i.hasClass("disabled")&&i.hasClass("range"))return o.s.minutesRange=s,void o._setTime();o.s.minutesRange=null}if("seconds"===n){if(i.hasClass("disabled")&&i.hasClass("range"))return o.s.secondsRange=s,void o._setTime();o.s.secondsRange=null}if("am"===s){if(!(12<=e.getUTCHours()))return;s=e.getUTCHours()-12}else if("pm"===s){if(!(e.getUTCHours()<12))return;s=e.getUTCHours()+12}e["hours"===n?"setUTCHours":"minutes"===n?"setUTCMinutes":"setSeconds"](s),o._setCalander(),o._setTime(),o._writeOutput(!0)}else(e=o._needValue()).setUTCDate(1),e.setUTCFullYear(t.data("year")),e.setUTCMonth(t.data("month")),e.setUTCDate(t.data("day")),o._writeOutput(!0),o.s.parts.time?(o._setCalander(),o._setTime()):setTimeout(function(){o._hide()},10);a()}}else o.dom.input.focus()})},_compareDates:function(t,e){return this._isLuxon()?r.DateTime.fromJSDate(t).toUTC().toISODate()===r.DateTime.fromJSDate(e).toUTC().toISODate():this._dateToUtcString(t)===this._dateToUtcString(e)},_convert:function(t,e,s){var i;return t&&(r?this._isLuxon()?(i=t instanceof Date?r.DateTime.fromJSDate(t).toUTC():r.DateTime.fromFormat(t,e)).isValid?s?i.toFormat(s):i.toJSDate():null:(i=t instanceof Date?r.utc(t,n,this.c.locale,this.c.strict):r(t,e,this.c.locale,this.c.strict)).isValid()?s?i.format(s):i.toDate():null:!e&&!s||e&&s?t:e?(i=t.match(/(\d{4})\-(\d{2})\-(\d{2})/))?new Date(i[1],i[2]-1,i[3]):null:t.getUTCFullYear()+"-"+this._pad(t.getUTCMonth()+1)+"-"+this._pad(t.getUTCDate()))},_correctMonth:function(t,e){var s=this._daysInMonth(t.getUTCFullYear(),e),i=t.getUTCDate()>s;t.setUTCMonth(e),i&&(t.setUTCDate(s),t.setUTCMonth(e))},_daysInMonth:function(t,e){return[31,t%4==0&&(t%100!=0||t%400==0)?29:28,31,30,31,30,31,31,30,31,30,31][e]},_dateToUtc:function(t){return t&&new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds()))},_dateToUtcString:function(t){return this._isLuxon()?r.DateTime.fromJSDate(t).toUTC().toISODate():t.getUTCFullYear()+"-"+this._pad(t.getUTCMonth()+1)+"-"+this._pad(t.getUTCDate())},_hide:function(t){!t&&"hidden"===this.dom.input.attr("type")||(t=this.s.namespace,this.dom.container.detach(),g(o).off("."+t),g(i).off("keydown."+t),g("div.dataTables_scrollBody").off("scroll."+t),g("div.DTE_Body_Content").off("scroll."+t),g("body").off("click."+t),g(this.dom.input[0].offsetParent).off("."+t))},_hours24To12:function(t){return 0===t?12:12<t?t-12:t},_htmlDay:function(t){var e,s;return t.empty?'<td class="empty"></td>':(e=["selectable"],s=this.c.classPrefix,t.disabled&&e.push("disabled"),t.today&&e.push("now"),t.selected&&e.push("selected"),'<td data-day="'+t.day+'" class="'+e.join(" ")+'"><button class="'+s+"-button "+s+'-day" type="button" data-year="'+t.year+'" data-month="'+t.month+'" data-day="'+t.day+'"><span>'+t.day+"</span></button></td>")},_htmlMonth:function(t,e){for(var s=this._dateToUtc(new Date),i=this._daysInMonth(t,e),n=new Date(Date.UTC(t,e,1)).getUTCDay(),a=[],o=[],r=(0<this.c.firstDay&&(n-=this.c.firstDay)<0&&(n+=7),i+n),d=r;7<d;)d-=7;r+=7-d;var l=this.c.minDate,h=this.c.maxDate;l&&(l.setUTCHours(0),l.setUTCMinutes(0),l.setSeconds(0)),h&&(h.setUTCHours(23),h.setUTCMinutes(59),h.setSeconds(59));for(var u=0,c=0;u<r;u++){var m=new Date(Date.UTC(t,e,u-n+1)),f=!!this.s.d&&this._compareDates(m,this.s.d),p=this._compareDates(m,s),y=u<n||i+n<=u,T=l&&m<l||h&&h<m,_=this.c.disableDays,f={day:u-n+1,month:e,year:t,selected:f,today:p,disabled:T=Array.isArray(_)&&-1!==g.inArray(m.getUTCDay(),_)||"function"==typeof _&&!0===_(m)?!0:T,empty:y};o.push(this._htmlDay(f)),7==++c&&(this.c.showWeekNumber&&o.unshift(this._htmlWeekOfYear(u-n,e,t)),a.push("<tr>"+o.join("")+"</tr>"),o=[],c=0)}var v,D=this.c.classPrefix,C=D+"-table";return this.c.showWeekNumber&&(C+=" weekNumber"),l&&(v=l>=new Date(Date.UTC(t,e,1,0,0,0)),this.dom.title.find("div."+D+"-iconLeft").css("display",v?"none":"block")),h&&(v=h<new Date(Date.UTC(t,e+1,1,0,0,0)),this.dom.title.find("div."+D+"-iconRight").css("display",v?"none":"block")),'<table class="'+C+'"><thead>'+this._htmlMonthHead()+"</thead><tbody>"+a.join("")+"</tbody></table>"},_htmlMonthHead:function(){var t=[],e=this.c.firstDay,s=this.c.i18n;this.c.showWeekNumber&&t.push("<th></th>");for(var i=0;i<7;i++)t.push("<th>"+function(t){for(t+=e;7<=t;)t-=7;return s.weekdays[t]}(i)+"</th>");return t.join("")},_htmlWeekOfYear:function(t,e,s){e=new Date(s,e,t,0,0,0,0),e.setDate(e.getDate()+4-(e.getDay()||7)),t=new Date(s,0,1),s=Math.ceil(((e-t)/864e5+1)/7);return'<td class="'+this.c.classPrefix+'-week">'+s+"</td>"},_isLuxon:function(){return!!(r&&r.DateTime&&r.Duration&&r.Settings)},_needValue:function(){return this.s.d||(this.s.d=this._dateToUtc(new Date),this.s.parts.time)||(this.s.d.setUTCHours(0),this.s.d.setUTCMinutes(0),this.s.d.setSeconds(0),this.s.d.setMilliseconds(0)),this.s.d},_options:function(t,e,s){s=s||e;var i=this.dom.container.find("select."+this.c.classPrefix+"-"+t);i.empty();for(var n=0,a=e.length;n<a;n++)i.append('<option value="'+e[n]+'">'+s[n]+"</option>")},_optionSet:function(t,e){var t=this.dom.container.find("select."+this.c.classPrefix+"-"+t),s=t.parent().children("span"),e=(t.val(e),t.find("option:selected"));s.html(0!==e.length?e.text():this.c.i18n.unknown)},_optionsTime:function(n,a,o,r,t){var e,d=this.c.classPrefix,s=this.dom.container.find("div."+d+"-"+n),i=12===a?function(t){return t}:this._pad,l=(d=this.c.classPrefix)+"-table",h=this.c.i18n;if(s.length){var u="",c=10,m=function(t,e,s){12===a&&"number"==typeof t&&(12<=o&&(t+=12),12==t?t=0:24==t&&(t=12));var i=o===t||"am"===t&&o<12||"pm"===t&&12<=o?"selected":"";return"number"==typeof t&&r&&-1===g.inArray(t,r)&&(i+=" disabled"),s&&(i+=" "+s),'<td class="selectable '+i+'"><button class="'+d+"-button "+d+'-day" type="button" data-unit="'+n+'" data-value="'+t+'"><span>'+e+"</span></button></td>"};if(12===a){for(u+="<tr>",e=1;e<=6;e++)u+=m(e,i(e));for(u=(u+=m("am",h.amPm[0]))+"</tr>"+"<tr>",e=7;e<=12;e++)u+=m(e,i(e));u=u+m("pm",h.amPm[1])+"</tr>",c=7}else{if(24===a)for(var f=0,p=0;p<4;p++){for(u+="<tr>",e=0;e<6;e++)u+=m(f,i(f)),f++;u+="</tr>"}else{for(u+="<tr>",p=0;p<60;p+=10)u+=m(p,i(p),"range");var u=u+"</tr>"+('</tbody></thead><table class="'+l+" "+l+'-nospace"><tbody>'),y=null!==t?t:-1===o?0:10*Math.floor(o/10);for(u+="<tr>",p=y+1;p<y+10;p++)u+=m(p,i(p));u+="</tr>"}c=6}s.empty().append('<table class="'+l+'"><thead><tr><th colspan="'+c+'">'+h[n]+"</th></tr></thead><tbody>"+u+"</tbody></table>")}},_optionsTitle:function(){var t=this.c.i18n,e=this.c.minDate,s=this.c.maxDate,e=e?e.getFullYear():null,s=s?s.getFullYear():null,e=null!==e?e:(new Date).getFullYear()-this.c.yearRange,s=null!==s?s:(new Date).getFullYear()+this.c.yearRange;this._options("month",this._range(0,11),t.months),this._options("year",this._range(e,s)),this.dom.today.text(t.today).text(t.today),this.dom.clear.text(t.clear).text(t.clear),this.dom.previous.attr("title",t.previous).children("button").text(t.previous),this.dom.next.attr("title",t.next).children("button").text(t.next)},_pad:function(t){return t<10?"0"+t:t},_position:function(){var t,e,s,i="input"===this.c.attachTo?this.dom.input.position():this.dom.input.offset(),n=this.dom.container,a=this.dom.input.outerHeight();n.hasClass("inline")?n.insertAfter(this.dom.input):(this.s.parts.date&&this.s.parts.time&&550<g(o).width()?n.addClass("horizontal"):n.removeClass("horizontal"),"input"===this.c.attachTo?n.css({top:i.top+a,left:i.left}).insertAfter(this.dom.input):n.css({top:i.top+a,left:i.left}).appendTo("body"),t=n.outerHeight(),e=n.outerWidth(),s=g(o).scrollTop(),i.top+a+t-s>g(o).height()&&(a=i.top-t,n.css("top",a<0?0:a)),e+i.left>g(o).width()&&(s=g(o).width()-e,"input"===this.c.attachTo&&(s-=g(n).offsetParent().offset().left),n.css("left",s<0?0:s)))},_range:function(t,e,s){var i=[];s=s||1;for(var n=t;n<=e;n+=s)i.push(n);return i},_setCalander:function(){this.s.display&&this.dom.calendar.empty().append(this._htmlMonth(this.s.display.getUTCFullYear(),this.s.display.getUTCMonth()))},_setTitle:function(){this._optionSet("month",this.s.display.getUTCMonth()),this._optionSet("year",this.s.display.getUTCFullYear())},_setTime:function(){function t(t){return e.c[t+"Available"]||e._range(0,59,e.c[t+"Increment"])}var e=this,s=this.s.d,i=null,n=null!=(i=this._isLuxon()?r.DateTime.fromJSDate(s).toUTC():i)?i.hour:s?s.getUTCHours():-1;this._optionsTime("hours",this.s.parts.hours12?12:24,n,this.c.hoursAvailable),this._optionsTime("minutes",60,null!=i?i.minute:s?s.getUTCMinutes():-1,t("minutes"),this.s.minutesRange),this._optionsTime("seconds",60,null!=i?i.second:s?s.getSeconds():-1,t("seconds"),this.s.secondsRange)},_show:function(){var e=this,t=this.s.namespace,s=(this._position(),g(o).on("scroll."+t+" resize."+t,function(){e._position()}),g("div.DTE_Body_Content").on("scroll."+t,function(){e._position()}),g("div.dataTables_scrollBody").on("scroll."+t,function(){e._position()}),this.dom.input[0].offsetParent);s!==i.body&&g(s).on("scroll."+t,function(){e._position()}),g(i).on("keydown."+t,function(t){9!==t.keyCode&&27!==t.keyCode&&13!==t.keyCode||e._hide()}),setTimeout(function(){g("body").on("click."+t,function(t){g(t.target).parents().filter(e.dom.container).length||t.target===e.dom.input[0]||e._hide()})},10)},_writeOutput:function(t){var e=this.s.d,s="",i=this.dom.input,e=(e&&(s=this._convert(e,null,this.c.format)),i.val(s),new Event("change",{bubbles:!0}));i[0].dispatchEvent(e),"hidden"===i.attr("type")&&this.val(s,!1),t&&i.focus()}}),a.use=function(t){r=t},a._instance=0,a.type="DateTime",a.defaults={attachTo:"body",buttons:{clear:!1,today:!1},classPrefix:"dt-datetime",disableDays:null,firstDay:1,format:"YYYY-MM-DD",hoursAvailable:null,i18n:{clear:"Clear",previous:"Previous",next:"Next",months:["January","February","March","April","May","June","July","August","September","October","November","December"],weekdays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],amPm:["am","pm"],hours:"Hour",minutes:"Minute",seconds:"Second",unknown:"-",today:"Today"},maxDate:null,minDate:null,minutesAvailable:null,minutesIncrement:1,strict:!0,locale:"en",onChange:function(){},secondsAvailable:null,secondsIncrement:1,showWeekNumber:!1,yearRange:25},a.version="1.5.0",a.factory=function(t,e){var s=!1;return t&&t.document&&(i=(o=t).document),e&&e.fn&&e.fn.jquery&&(g=e,s=!0),s},o.DateTime||(o.DateTime=a),o.DataTable&&(o.DataTable.DateTime=a),g.fn.dtDateTime=function(t){return this.each(function(){new a(this,t)})},g.fn.dataTable&&(g.fn.dataTable.DateTime=a,g.fn.DataTable.DateTime=a,g.fn.dataTable.Editor)&&(g.fn.dataTable.Editor.DateTime=a),a});
|