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.
Files changed (54) hide show
  1. package/datatables.net-datetime.1.5.0.nupkg +0 -0
  2. package/dist/dataTables.dateTime.js +381 -375
  3. package/dist/dataTables.dateTime.min.js +2 -2
  4. package/dist/dataTables.dateTime.min.mjs +2 -2
  5. package/dist/dataTables.dateTime.mjs +380 -374
  6. package/docs/api/DateTime.use().xml +0 -2
  7. package/docs/api/destroy().xml +0 -2
  8. package/docs/api/display().xml +1 -1
  9. package/docs/api/errorMsg().xml +2 -6
  10. package/docs/api/hide().xml +0 -4
  11. package/docs/api/max().xml +1 -3
  12. package/docs/api/min().xml +1 -3
  13. package/docs/api/owns().xml +2 -4
  14. package/docs/api/val().xml +2 -6
  15. package/docs/api/valFormat().xml +2 -6
  16. package/docs/option/buttons.clear.xml +0 -2
  17. package/docs/option/buttons.today.xml +0 -2
  18. package/docs/option/buttons.xml +0 -2
  19. package/docs/option/disableDays.xml +3 -3
  20. package/docs/option/format.xml +1 -3
  21. package/docs/option/hoursAvailable.xml +2 -2
  22. package/docs/option/i18n.amPm.xml +1 -1
  23. package/docs/option/i18n.clear.xml +1 -3
  24. package/docs/option/i18n.hours.xml +1 -1
  25. package/docs/option/i18n.minutes.xml +1 -1
  26. package/docs/option/i18n.months.xml +15 -2
  27. package/docs/option/i18n.next.xml +2 -2
  28. package/docs/option/i18n.previous.xml +2 -2
  29. package/docs/option/i18n.seconds.xml +1 -1
  30. package/docs/option/i18n.today.xml +1 -3
  31. package/docs/option/i18n.unknown.xml +1 -1
  32. package/docs/option/i18n.weekdays.xml +1 -1
  33. package/docs/option/i18n.xml +3 -5
  34. package/docs/option/locale.xml +0 -2
  35. package/docs/option/maxDate.xml +0 -4
  36. package/docs/option/minDate.xml +0 -4
  37. package/docs/option/minutesAvailable.xml +2 -2
  38. package/docs/option/onChange.xml +0 -2
  39. package/docs/option/secondsAvailable.xml +2 -2
  40. package/docs/option/showWeekNumber.xml +2 -2
  41. package/docs/option/yearRange.xml +2 -2
  42. package/examples/initialisation/datetime.xml +2 -2
  43. package/examples/initialisation/moment.xml +2 -2
  44. package/examples/integration/form.xml +20 -2
  45. package/js/dataTables.dateTime.js +380 -374
  46. package/nuget.nuspec +1 -1
  47. package/package.json +1 -1
  48. package/test/api/dateTime.display().js +47 -0
  49. package/test/options/dateTime.buttons.js +71 -0
  50. package/test/options/dateTime.hoursAvailable.js +38 -0
  51. package/test/options/dateTime.locale.js +31 -0
  52. package/test/options/dateTime.minutesAvailable.js +46 -0
  53. package/test/options/dateTime.secondsAvailable.js +46 -0
  54. package/datatables.net-datetime.1.4.0.nupkg +0 -0
@@ -21,12 +21,10 @@
21
21
  </description>
22
22
 
23
23
  <example title="Use Moment"><![CDATA[
24
-
25
24
  DateTime.use(moment);
26
25
 
27
26
  let el = document.getElementById('example');
28
27
  let dt = new DateTime(el);
29
-
30
28
  ]]></example>
31
29
 
32
30
  </dt-api>
@@ -17,12 +17,10 @@
17
17
  </description>
18
18
 
19
19
  <example title="Destroy DateTime instance"><![CDATA[
20
-
21
20
  var dt = new DateTime(document.getElementById('example'));
22
21
 
23
22
  // Then sometime later, destroy it...
24
23
  dt.destroy();
25
-
26
24
  ]]></example>
27
25
 
28
26
  </dt-api>
@@ -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>
@@ -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>
@@ -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>
@@ -26,10 +26,8 @@
26
26
  </description>
27
27
 
28
28
  <example title="Set the max date for DateTime"><![CDATA[
29
-
30
29
  var dt = new DateTime(document.getElementById('example'));
31
- dt.max("2025-12-31");
32
-
30
+ dt.max('2025-12-31');
33
31
  ]]></example>
34
32
 
35
33
  </dt-api>
@@ -26,10 +26,8 @@
26
26
  </description>
27
27
 
28
28
  <example title="Set the min date for DateTime"><![CDATA[
29
-
30
29
  var dt = new DateTime(document.getElementById('example'));
31
- dt.min("2015-12-31");
32
-
30
+ dt.min('2015-12-31');
33
31
  ]]></example>
34
32
 
35
33
  </dt-api>
@@ -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("It is owned");
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>
@@ -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("2021-12-31");
41
-
37
+ dt.val('2021-12-31');
42
38
  ]]></example>
43
39
 
44
40
  </dt-api>
@@ -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>
@@ -13,13 +13,11 @@
13
13
  </description>
14
14
 
15
15
  <example title="Enable clear button"><![CDATA[
16
-
17
16
  new DateTime(document.getElementById('test'), {
18
17
  buttons: {
19
18
  clear: true
20
19
  }
21
20
  });
22
-
23
21
  ]]></example>
24
22
 
25
23
  <related>de-init buttons.today</related>
@@ -15,13 +15,11 @@
15
15
  </description>
16
16
 
17
17
  <example title="Enable today button"><![CDATA[
18
-
19
18
  new DateTime(document.getElementById('test'), {
20
19
  buttons: {
21
20
  today: true
22
21
  }
23
22
  });
24
-
25
23
  ]]></example>
26
24
 
27
25
  <related>de-init buttons.clear</related>
@@ -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
- new DateTime(document.getElementById('test'), {
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>
@@ -21,11 +21,9 @@
21
21
  </description>
22
22
 
23
23
  <example title="Change format to use '/' instead of '-'."><![CDATA[
24
-
25
24
  new DateTime(document.getElementById('test'), {
26
- format: 'YYYY/MM/DD
25
+ format: 'YYYY/MM/DD'
27
26
  });
28
-
29
27
  ]]></example>
30
28
 
31
29
  </dt-option>
@@ -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
- new DateTime(document.getElementById('test'), {
29
+ $(document).ready(function () {
30
+ new DateTime(document.getElementById('test'), {
31
31
  hoursAvailable: [8, 9, 10]
32
32
  });
33
33
  });
@@ -19,7 +19,7 @@
19
19
  </description>
20
20
 
21
21
  <example title="Change the strings for am and pm"><![CDATA[
22
- $(document).ready(function() {
22
+ $(document).ready(function () {
23
23
  new DateTime(document.getElementById('test'), {
24
24
  format: 'HH:mm A',
25
25
  i18n: {
@@ -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: "Empty"
19
+ clear: 'Empty'
21
20
  }
22
21
  });
23
-
24
22
  ]]></example>
25
23
 
26
24
  <related>de-init buttons.clear</related>
@@ -20,7 +20,7 @@
20
20
  </description>
21
21
 
22
22
  <example title="Change the value for `i18n.hours`"><![CDATA[
23
- $(document).ready(function() {
23
+ $(document).ready(function () {
24
24
  new DateTime(document.getElementById('test'), {
25
25
  format: 'HH:mm',
26
26
  i18n: {
@@ -20,7 +20,7 @@
20
20
  </description>
21
21
 
22
22
  <example title="Change the value for `i18n.minutes`"><![CDATA[
23
- $(document).ready(function() {
23
+ $(document).ready(function () {
24
24
  new DateTime(document.getElementById('test'), {
25
25
  format: 'HH:mm',
26
26
  i18n: {
@@ -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: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
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
- new DateTime(document.getElementById('test'), {
23
+ $(document).ready(function () {
24
+ new DateTime(document.getElementById('test'), {
25
25
  i18n: {
26
26
  next: '&gt;'
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
- new DateTime(document.getElementById('test'), {
23
+ $(document).ready(function () {
24
+ new DateTime(document.getElementById('test'), {
25
25
  i18n: {
26
26
  previous: '&lt;'
27
27
  }
@@ -20,7 +20,7 @@
20
20
  </description>
21
21
 
22
22
  <example title="Change the value for `i18n.seconds`"><![CDATA[
23
- $(document).ready(function() {
23
+ $(document).ready(function () {
24
24
  new DateTime(document.getElementById('test'), {
25
25
  format: 'HH:mm:ss',
26
26
  i18n: {
@@ -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: "Jump to 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="Change the value for `i18n.unknown`"><![CDATA[
23
- $(document).ready(function() {
23
+ $(document).ready(function () {
24
24
  new DateTime(document.getElementById('test'), {
25
25
  i18n: {
26
26
  unknown: 'n/a'
@@ -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']
@@ -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: '&lt;'
28
+ previous: '&lt;',
30
29
  next: '&gt;'
31
30
  }
32
- });
31
+ });
33
32
  });
34
-
35
33
  ]]></example>
36
34
 
37
35
  </dt-option>
@@ -21,11 +21,9 @@
21
21
  </description>
22
22
 
23
23
  <example title="Change the locale to French"><![CDATA[
24
-
25
24
  new DateTime(document.getElementById('test'), {
26
25
  locale: 'fr'
27
26
  });
28
-
29
27
  ]]></example>
30
28
 
31
29
  </dt-option>
@@ -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>
@@ -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
- new DateTime(document.getElementById('test'), {
29
+ $(document).ready(function () {
30
+ new DateTime(document.getElementById('test'), {
31
31
  minutesAvailable: [00, 15, 30, 45]
32
32
  });
33
33
  });
@@ -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
- new DateTime(document.getElementById('test'), {
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
- new DateTime(document.getElementById('test'), {
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
- new DateTime(document.getElementById('test'), {
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
- format: 'D MMM YYYY HH:mm'
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
- format: 'D MMM YYYY HH:mm'
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
- format: 'D/M/YYYY'
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
- format: 'D/M/YYYY'
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('Making an appointment for ' + name + ' (' + phone + ') on ' + date + ' at ' + time);
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('Making an appointment for ' + name + ' (' + phone + ') on ' + date + ' at ' + time);
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
  ]]>