datatables.net-datetime 1.5.0 → 1.5.2
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/datatables.net-datetime.1.5.0.nupkg +0 -0
- package/dist/dataTables.dateTime.js +381 -375
- package/dist/dataTables.dateTime.min.js +2 -2
- package/dist/dataTables.dateTime.min.mjs +2 -2
- package/dist/dataTables.dateTime.mjs +380 -374
- package/docs/api/DateTime.use().xml +0 -2
- package/docs/api/destroy().xml +0 -2
- package/docs/api/display().xml +1 -1
- package/docs/api/errorMsg().xml +2 -6
- package/docs/api/hide().xml +0 -4
- package/docs/api/max().xml +1 -3
- package/docs/api/min().xml +1 -3
- package/docs/api/owns().xml +2 -4
- package/docs/api/val().xml +2 -6
- package/docs/api/valFormat().xml +2 -6
- package/docs/option/buttons.clear.xml +0 -2
- package/docs/option/buttons.today.xml +0 -2
- package/docs/option/buttons.xml +0 -2
- package/docs/option/disableDays.xml +3 -3
- package/docs/option/format.xml +1 -3
- package/docs/option/hoursAvailable.xml +2 -2
- package/docs/option/i18n.amPm.xml +1 -1
- package/docs/option/i18n.clear.xml +1 -3
- package/docs/option/i18n.hours.xml +1 -1
- package/docs/option/i18n.minutes.xml +1 -1
- package/docs/option/i18n.months.xml +15 -2
- package/docs/option/i18n.next.xml +2 -2
- package/docs/option/i18n.previous.xml +2 -2
- package/docs/option/i18n.seconds.xml +1 -1
- package/docs/option/i18n.today.xml +1 -3
- package/docs/option/i18n.unknown.xml +1 -1
- package/docs/option/i18n.weekdays.xml +1 -1
- package/docs/option/i18n.xml +3 -5
- package/docs/option/locale.xml +0 -2
- package/docs/option/maxDate.xml +0 -4
- package/docs/option/minDate.xml +0 -4
- package/docs/option/minutesAvailable.xml +2 -2
- package/docs/option/onChange.xml +0 -2
- package/docs/option/secondsAvailable.xml +2 -2
- package/docs/option/showWeekNumber.xml +2 -2
- package/docs/option/yearRange.xml +2 -2
- package/examples/initialisation/datetime.xml +2 -2
- package/examples/initialisation/moment.xml +2 -2
- package/examples/integration/form.xml +20 -2
- package/js/dataTables.dateTime.js +380 -374
- package/nuget.nuspec +1 -1
- package/package.json +1 -1
- package/test/api/dateTime.display().js +47 -0
- package/test/options/dateTime.buttons.js +71 -0
- package/test/options/dateTime.hoursAvailable.js +38 -0
- package/test/options/dateTime.locale.js +31 -0
- package/test/options/dateTime.minutesAvailable.js +46 -0
- package/test/options/dateTime.secondsAvailable.js +46 -0
- package/datatables.net-datetime.1.4.0.nupkg +0 -0
package/docs/api/destroy().xml
CHANGED
package/docs/api/display().xml
CHANGED
|
@@ -24,6 +24,6 @@
|
|
|
24
24
|
<description>
|
|
25
25
|
This method is used to programmatically control the calendar month that is shown to the end user. That can be useful for jumping around long time periods, or encouraging users to enter data in a specific month.
|
|
26
26
|
|
|
27
|
-
It might typically be used with a `change` or `focus` event listener. The get value should only relied upon when the calendar display is shown (field has focus), and the setter will only have an affect under the same condition.
|
|
27
|
+
It might typically be used with a `change` or `focus` event listener. The get value should only be relied upon when the calendar display is shown (field has focus), and the setter will only have an affect under the same condition.
|
|
28
28
|
</description>
|
|
29
29
|
</dt-api>
|
package/docs/api/errorMsg().xml
CHANGED
|
@@ -25,15 +25,12 @@
|
|
|
25
25
|
</description>
|
|
26
26
|
|
|
27
27
|
<example title="Set Error Message"><![CDATA[
|
|
28
|
-
|
|
29
28
|
var dt = new DateTime(document.getElementById('example'));
|
|
30
29
|
|
|
31
30
|
dt.errMsg('Oops an error occurred!');
|
|
32
|
-
|
|
33
31
|
]]></example>
|
|
34
32
|
|
|
35
33
|
<example title="Basic validation - set and clear an error message"><![CDATA[
|
|
36
|
-
|
|
37
34
|
var dt = new DateTime(document.getElementById('example'));
|
|
38
35
|
|
|
39
36
|
el.addEventListener('change', function () {
|
|
@@ -43,10 +40,9 @@ el.addEventListener('change', function () {
|
|
|
43
40
|
}
|
|
44
41
|
else {
|
|
45
42
|
// No value - error
|
|
46
|
-
dt.errMsg('oops an error occurred!);
|
|
43
|
+
dt.errMsg('oops an error occurred!');
|
|
47
44
|
}
|
|
48
|
-
}
|
|
49
|
-
|
|
45
|
+
});
|
|
50
46
|
]]></example>
|
|
51
47
|
|
|
52
48
|
</dt-api>
|
package/docs/api/hide().xml
CHANGED
|
@@ -17,20 +17,16 @@
|
|
|
17
17
|
</description>
|
|
18
18
|
|
|
19
19
|
<example title="Hide an instance of DateTime"><![CDATA[
|
|
20
|
-
|
|
21
20
|
var dt = new DateTime(document.getElementById('#dtInput'));
|
|
22
21
|
dt.hide();
|
|
23
|
-
|
|
24
22
|
]]></example>
|
|
25
23
|
|
|
26
24
|
<example title="Ensure the date picker is hidden when closing a Bootstrap 4 modal"><![CDATA[
|
|
27
|
-
|
|
28
25
|
var dt = new DateTime($('#dtInput'));
|
|
29
26
|
|
|
30
27
|
$('#myModal').on('hide.bs.modal', function (event) {
|
|
31
28
|
dt.hide();
|
|
32
29
|
});
|
|
33
|
-
|
|
34
30
|
]]></example>
|
|
35
31
|
|
|
36
32
|
</dt-api>
|
package/docs/api/max().xml
CHANGED
package/docs/api/min().xml
CHANGED
package/docs/api/owns().xml
CHANGED
|
@@ -18,13 +18,11 @@
|
|
|
18
18
|
</description>
|
|
19
19
|
|
|
20
20
|
<example title=""><![CDATA[
|
|
21
|
-
|
|
22
21
|
var dt = new DateTime(document.getElementById('example'));
|
|
23
22
|
|
|
24
|
-
if(dt.owns(document.getElementByClassName('dt-datetime-date'))) {
|
|
25
|
-
console.log(
|
|
23
|
+
if (dt.owns(document.getElementByClassName('dt-datetime-date'))) {
|
|
24
|
+
console.log('It is owned');
|
|
26
25
|
}
|
|
27
|
-
|
|
28
26
|
]]></example>
|
|
29
27
|
|
|
30
28
|
</dt-api>
|
package/docs/api/val().xml
CHANGED
|
@@ -23,22 +23,18 @@
|
|
|
23
23
|
</description>
|
|
24
24
|
|
|
25
25
|
<example title="Get a value from the input"><![CDATA[
|
|
26
|
-
|
|
27
26
|
let el = document.getElementById('example');
|
|
28
27
|
let dt = new DateTime(el);
|
|
29
28
|
|
|
30
29
|
el.addEventListener('change', function () {
|
|
31
30
|
console.log('Selected value is: ', dt.val());
|
|
32
|
-
}
|
|
33
|
-
|
|
31
|
+
});
|
|
34
32
|
]]></example>
|
|
35
33
|
|
|
36
34
|
<example title="Set a value into the input"><![CDATA[
|
|
37
|
-
|
|
38
35
|
let dt = new DateTime(document.getElementById('example'));
|
|
39
36
|
|
|
40
|
-
dt.val(
|
|
41
|
-
|
|
37
|
+
dt.val('2021-12-31');
|
|
42
38
|
]]></example>
|
|
43
39
|
|
|
44
40
|
</dt-api>
|
package/docs/api/valFormat().xml
CHANGED
|
@@ -31,22 +31,18 @@
|
|
|
31
31
|
</description>
|
|
32
32
|
|
|
33
33
|
<example title="Get a value from the input with a specific format"><![CDATA[
|
|
34
|
-
|
|
35
34
|
let el = document.getElementById('example');
|
|
36
35
|
let dt = new DateTime(el);
|
|
37
36
|
|
|
38
37
|
el.addEventListener('change', function () {
|
|
39
38
|
console.log('Selected value is: ', dt.valFormat('MM-DD-YYYY'));
|
|
40
|
-
}
|
|
41
|
-
|
|
39
|
+
});
|
|
42
40
|
]]></example>
|
|
43
41
|
|
|
44
42
|
<example title="Set a value into the input from a formatted string"><![CDATA[
|
|
45
|
-
|
|
46
43
|
let dt = new DateTime(document.getElementById('example'));
|
|
47
44
|
|
|
48
|
-
dt.valFormat('MM-DD-YY', '03-02-23
|
|
49
|
-
|
|
45
|
+
dt.valFormat('MM-DD-YY', '03-02-23');
|
|
50
46
|
]]></example>
|
|
51
47
|
|
|
52
48
|
</dt-api>
|
package/docs/option/buttons.xml
CHANGED
|
@@ -12,14 +12,12 @@
|
|
|
12
12
|
</description>
|
|
13
13
|
|
|
14
14
|
<example title="Enable clear and today buttons"><![CDATA[
|
|
15
|
-
|
|
16
15
|
new DateTime(document.getElementById('test'), {
|
|
17
16
|
buttons: {
|
|
18
17
|
today: true,
|
|
19
18
|
clear: true
|
|
20
19
|
}
|
|
21
20
|
});
|
|
22
|
-
|
|
23
21
|
]]></example>
|
|
24
22
|
|
|
25
23
|
<related>de-init buttons.clear</related>
|
|
@@ -35,9 +35,9 @@
|
|
|
35
35
|
</description>
|
|
36
36
|
|
|
37
37
|
<example title="Disable selection of Saturdays and Sundays"><![CDATA[
|
|
38
|
-
$(document).ready(function() {
|
|
39
|
-
|
|
40
|
-
disableDays: [5,6]
|
|
38
|
+
$(document).ready(function () {
|
|
39
|
+
new DateTime(document.getElementById('test'), {
|
|
40
|
+
disableDays: [5, 6]
|
|
41
41
|
});
|
|
42
42
|
});
|
|
43
43
|
]]></example>
|
package/docs/option/format.xml
CHANGED
|
@@ -26,8 +26,8 @@
|
|
|
26
26
|
</description>
|
|
27
27
|
|
|
28
28
|
<example title="Restrict the user to select either 8, 9 or 10"><![CDATA[
|
|
29
|
-
$(document).ready(function() {
|
|
30
|
-
|
|
29
|
+
$(document).ready(function () {
|
|
30
|
+
new DateTime(document.getElementById('test'), {
|
|
31
31
|
hoursAvailable: [8, 9, 10]
|
|
32
32
|
});
|
|
33
33
|
});
|
|
@@ -11,16 +11,14 @@
|
|
|
11
11
|
</description>
|
|
12
12
|
|
|
13
13
|
<example title="Set clear button text"><![CDATA[
|
|
14
|
-
|
|
15
14
|
new DateTime(document.getElementById('test'), {
|
|
16
15
|
buttons: {
|
|
17
16
|
clear: true
|
|
18
17
|
},
|
|
19
18
|
i18n: {
|
|
20
|
-
clear:
|
|
19
|
+
clear: 'Empty'
|
|
21
20
|
}
|
|
22
21
|
});
|
|
23
|
-
|
|
24
22
|
]]></example>
|
|
25
23
|
|
|
26
24
|
<related>de-init buttons.clear</related>
|
|
@@ -20,10 +20,23 @@
|
|
|
20
20
|
</description>
|
|
21
21
|
|
|
22
22
|
<example title="Abbreviated values for days Months"><![CDATA[
|
|
23
|
-
$(document).ready(function() {
|
|
23
|
+
$(document).ready(function () {
|
|
24
24
|
new DateTime(document.getElementById('test'), {
|
|
25
25
|
i18n: {
|
|
26
|
-
months: [
|
|
26
|
+
months: [
|
|
27
|
+
'Jan',
|
|
28
|
+
'Feb',
|
|
29
|
+
'Mar',
|
|
30
|
+
'Apr',
|
|
31
|
+
'May',
|
|
32
|
+
'Jun',
|
|
33
|
+
'Jul',
|
|
34
|
+
'Aug',
|
|
35
|
+
'Sep',
|
|
36
|
+
'Oct',
|
|
37
|
+
'Nov',
|
|
38
|
+
'Dec'
|
|
39
|
+
]
|
|
27
40
|
}
|
|
28
41
|
});
|
|
29
42
|
});
|
|
@@ -20,8 +20,8 @@
|
|
|
20
20
|
</description>
|
|
21
21
|
|
|
22
22
|
<example title="Change the value for `i18n.next`"><![CDATA[
|
|
23
|
-
$(document).ready(function() {
|
|
24
|
-
|
|
23
|
+
$(document).ready(function () {
|
|
24
|
+
new DateTime(document.getElementById('test'), {
|
|
25
25
|
i18n: {
|
|
26
26
|
next: '>'
|
|
27
27
|
}
|
|
@@ -20,8 +20,8 @@
|
|
|
20
20
|
</description>
|
|
21
21
|
|
|
22
22
|
<example title="Change the value for `i18n.previous`"><![CDATA[
|
|
23
|
-
$(document).ready(function() {
|
|
24
|
-
|
|
23
|
+
$(document).ready(function () {
|
|
24
|
+
new DateTime(document.getElementById('test'), {
|
|
25
25
|
i18n: {
|
|
26
26
|
previous: '<'
|
|
27
27
|
}
|
|
@@ -11,16 +11,14 @@
|
|
|
11
11
|
</description>
|
|
12
12
|
|
|
13
13
|
<example title="Set today button text"><![CDATA[
|
|
14
|
-
|
|
15
14
|
new DateTime(document.getElementById('test'), {
|
|
16
15
|
buttons: {
|
|
17
16
|
today: true
|
|
18
17
|
},
|
|
19
18
|
i18n: {
|
|
20
|
-
today:
|
|
19
|
+
today: 'Jump to today'
|
|
21
20
|
}
|
|
22
21
|
});
|
|
23
|
-
|
|
24
22
|
]]></example>
|
|
25
23
|
|
|
26
24
|
<related>de-init buttons.today</related>
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
</description>
|
|
21
21
|
|
|
22
22
|
<example title="French values for days of the week"><![CDATA[
|
|
23
|
-
$(document).ready(function() {
|
|
23
|
+
$(document).ready(function () {
|
|
24
24
|
new DateTime(document.getElementById('test'), {
|
|
25
25
|
i18n: {
|
|
26
26
|
weekdays: ['Dim', 'Lun', 'Mar', 'Mer', 'Jeu', 'Ven', 'Dim']
|
package/docs/option/i18n.xml
CHANGED
|
@@ -22,16 +22,14 @@
|
|
|
22
22
|
</description>
|
|
23
23
|
|
|
24
24
|
<example title="Alter previous and next buttons"><![CDATA[
|
|
25
|
-
|
|
26
|
-
$(document).ready(function() {
|
|
25
|
+
$(document).ready(function () {
|
|
27
26
|
var dt = new DateTime(document.getElementById('example'), {
|
|
28
27
|
i18n: {
|
|
29
|
-
previous: '<'
|
|
28
|
+
previous: '<',
|
|
30
29
|
next: '>'
|
|
31
30
|
}
|
|
32
|
-
|
|
31
|
+
});
|
|
33
32
|
});
|
|
34
|
-
|
|
35
33
|
]]></example>
|
|
36
34
|
|
|
37
35
|
</dt-option>
|
package/docs/option/locale.xml
CHANGED
package/docs/option/maxDate.xml
CHANGED
|
@@ -30,19 +30,15 @@
|
|
|
30
30
|
</description>
|
|
31
31
|
|
|
32
32
|
<example title="Set maxDate to the end of 2029 using a RFC 2822 string"><![CDATA[
|
|
33
|
-
|
|
34
33
|
new DateTime(document.getElementById('test'), {
|
|
35
34
|
maxDate: 'December 31, 2029 23:59:59'
|
|
36
35
|
});
|
|
37
|
-
|
|
38
36
|
]]></example>
|
|
39
37
|
|
|
40
38
|
<example title="Set maxDate to the end of 2029 using a Date (from ISO8601 format)"><![CDATA[
|
|
41
|
-
|
|
42
39
|
new DateTime(document.getElementById('test'), {
|
|
43
40
|
maxDate: new Date('2029-12-31 23:59:59')
|
|
44
41
|
});
|
|
45
|
-
|
|
46
42
|
]]></example>
|
|
47
43
|
|
|
48
44
|
<related>de-init minDate</related>
|
package/docs/option/minDate.xml
CHANGED
|
@@ -31,19 +31,15 @@
|
|
|
31
31
|
</description>
|
|
32
32
|
|
|
33
33
|
<example title="Set minDate to the start of 2000 using a RFC 2822 string"><![CDATA[
|
|
34
|
-
|
|
35
34
|
new DateTime(document.getElementById('test'), {
|
|
36
35
|
minDate: 'January 1, 2000 00:00:00'
|
|
37
36
|
});
|
|
38
|
-
|
|
39
37
|
]]></example>
|
|
40
38
|
|
|
41
39
|
<example title="Set minDate to the start of 2000 using a Date (from ISO8601 format)"><![CDATA[
|
|
42
|
-
|
|
43
40
|
new DateTime(document.getElementById('test'), {
|
|
44
41
|
minDate: new Date('2000-01-01 00:00:00')
|
|
45
42
|
});
|
|
46
|
-
|
|
47
43
|
]]></example>
|
|
48
44
|
|
|
49
45
|
<related>de-init maxDate</related>
|
|
@@ -26,8 +26,8 @@
|
|
|
26
26
|
</description>
|
|
27
27
|
|
|
28
28
|
<example title="Restrict the user to select either 00, 15, 30 or 45"><![CDATA[
|
|
29
|
-
$(document).ready(function() {
|
|
30
|
-
|
|
29
|
+
$(document).ready(function () {
|
|
30
|
+
new DateTime(document.getElementById('test'), {
|
|
31
31
|
minutesAvailable: [00, 15, 30, 45]
|
|
32
32
|
});
|
|
33
33
|
});
|
package/docs/option/onChange.xml
CHANGED
|
@@ -26,13 +26,11 @@
|
|
|
26
26
|
</description>
|
|
27
27
|
|
|
28
28
|
<example title="Alert the user that they have made a change"><![CDATA[
|
|
29
|
-
|
|
30
29
|
new DateTime(document.getElementById('test'), {
|
|
31
30
|
onChange: function (value, date, input) {
|
|
32
31
|
alert('Your new value is ' + value);
|
|
33
32
|
}
|
|
34
33
|
});
|
|
35
|
-
|
|
36
34
|
]]></example>
|
|
37
35
|
|
|
38
36
|
</dt-option>
|
|
@@ -26,8 +26,8 @@
|
|
|
26
26
|
</description>
|
|
27
27
|
|
|
28
28
|
<example title="Restrict the user to select either 00, 15, 30 or 45"><![CDATA[
|
|
29
|
-
$(document).ready(function() {
|
|
30
|
-
|
|
29
|
+
$(document).ready(function () {
|
|
30
|
+
new DateTime(document.getElementById('test'), {
|
|
31
31
|
secondsAvailable: [00, 15, 30, 45]
|
|
32
32
|
});
|
|
33
33
|
});
|
|
@@ -20,8 +20,8 @@
|
|
|
20
20
|
</description>
|
|
21
21
|
|
|
22
22
|
<example title="Show the ISO week number"><![CDATA[
|
|
23
|
-
$(document).ready(function() {
|
|
24
|
-
|
|
23
|
+
$(document).ready(function () {
|
|
24
|
+
new DateTime(document.getElementById('test'), {
|
|
25
25
|
showWeekNumber: true
|
|
26
26
|
});
|
|
27
27
|
});
|
|
@@ -22,8 +22,8 @@
|
|
|
22
22
|
</description>
|
|
23
23
|
|
|
24
24
|
<example title="Set the year range to 50"><![CDATA[
|
|
25
|
-
$(document).ready(function() {
|
|
26
|
-
|
|
25
|
+
$(document).ready(function () {
|
|
26
|
+
new DateTime(document.getElementById('test'), {
|
|
27
27
|
yearRange: 50
|
|
28
28
|
});
|
|
29
29
|
});
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
<![CDATA[
|
|
8
8
|
|
|
9
9
|
$('#test').dtDateTime({
|
|
10
|
-
|
|
10
|
+
format: 'D MMM YYYY HH:mm'
|
|
11
11
|
});
|
|
12
12
|
|
|
13
13
|
]]>
|
|
@@ -17,7 +17,7 @@ $('#test').dtDateTime({
|
|
|
17
17
|
<![CDATA[
|
|
18
18
|
|
|
19
19
|
new DateTime(document.getElementById('test'), {
|
|
20
|
-
|
|
20
|
+
format: 'D MMM YYYY HH:mm'
|
|
21
21
|
});
|
|
22
22
|
|
|
23
23
|
]]>
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
<![CDATA[
|
|
7
7
|
|
|
8
8
|
new DateTime(document.getElementById('test'), {
|
|
9
|
-
|
|
9
|
+
format: 'D/M/YYYY'
|
|
10
10
|
});
|
|
11
11
|
|
|
12
12
|
]]>
|
|
@@ -16,7 +16,7 @@ new DateTime(document.getElementById('test'), {
|
|
|
16
16
|
<![CDATA[
|
|
17
17
|
|
|
18
18
|
new DateTime(document.getElementById('test'), {
|
|
19
|
-
|
|
19
|
+
format: 'D/M/YYYY'
|
|
20
20
|
});
|
|
21
21
|
|
|
22
22
|
]]>
|
|
@@ -20,7 +20,16 @@ $('#appointment').on('submit', function (e) {
|
|
|
20
20
|
var date = $('#inputDate').val();
|
|
21
21
|
var time = $('#inputTime').val();
|
|
22
22
|
|
|
23
|
-
alert(
|
|
23
|
+
alert(
|
|
24
|
+
'Making an appointment for ' +
|
|
25
|
+
name +
|
|
26
|
+
' (' +
|
|
27
|
+
phone +
|
|
28
|
+
') on ' +
|
|
29
|
+
date +
|
|
30
|
+
' at ' +
|
|
31
|
+
time
|
|
32
|
+
);
|
|
24
33
|
});
|
|
25
34
|
|
|
26
35
|
]]>
|
|
@@ -43,7 +52,16 @@ document.querySelector('#appointment').addEventListener('submit', function (e) {
|
|
|
43
52
|
let date = document.querySelector('#inputDate').value;
|
|
44
53
|
let time = document.querySelector('#inputTime').value;
|
|
45
54
|
|
|
46
|
-
alert(
|
|
55
|
+
alert(
|
|
56
|
+
'Making an appointment for ' +
|
|
57
|
+
name +
|
|
58
|
+
' (' +
|
|
59
|
+
phone +
|
|
60
|
+
') on ' +
|
|
61
|
+
date +
|
|
62
|
+
' at ' +
|
|
63
|
+
time
|
|
64
|
+
);
|
|
47
65
|
});
|
|
48
66
|
|
|
49
67
|
]]>
|