date-and-time 0.14.2 → 2.0.1

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 (133) hide show
  1. package/EXTEND.md +29 -11
  2. package/LOCALE.md +19 -34
  3. package/PLUGINS.md +222 -113
  4. package/README.md +203 -171
  5. package/date-and-time.js +171 -147
  6. package/date-and-time.min.js +14 -14
  7. package/esm/date-and-time.es.js +466 -0
  8. package/esm/date-and-time.es.min.js +17 -0
  9. package/esm/date-and-time.mjs +466 -0
  10. package/esm/locale/ar.es.js +39 -0
  11. package/esm/locale/ar.mjs +39 -0
  12. package/esm/locale/az.es.js +44 -0
  13. package/esm/locale/az.mjs +44 -0
  14. package/esm/locale/bn.es.js +50 -0
  15. package/esm/locale/bn.mjs +50 -0
  16. package/esm/locale/cs.es.js +22 -0
  17. package/esm/locale/cs.mjs +22 -0
  18. package/esm/locale/de.es.js +23 -0
  19. package/esm/locale/de.mjs +23 -0
  20. package/esm/locale/dk.es.js +22 -0
  21. package/esm/locale/dk.mjs +22 -0
  22. package/esm/locale/el.es.js +44 -0
  23. package/esm/locale/el.mjs +44 -0
  24. package/esm/locale/en.es.js +13 -0
  25. package/esm/locale/en.mjs +13 -0
  26. package/esm/locale/es.es.js +42 -0
  27. package/esm/locale/es.mjs +42 -0
  28. package/esm/locale/fa.es.js +39 -0
  29. package/esm/locale/fa.mjs +39 -0
  30. package/esm/locale/fr.es.js +23 -0
  31. package/esm/locale/fr.mjs +23 -0
  32. package/esm/locale/hi.es.js +50 -0
  33. package/esm/locale/hi.mjs +50 -0
  34. package/esm/locale/hu.es.js +23 -0
  35. package/esm/locale/hu.mjs +23 -0
  36. package/esm/locale/id.es.js +46 -0
  37. package/esm/locale/id.mjs +46 -0
  38. package/esm/locale/it.es.js +23 -0
  39. package/esm/locale/it.mjs +23 -0
  40. package/esm/locale/ja.es.js +31 -0
  41. package/esm/locale/ja.mjs +31 -0
  42. package/esm/locale/jv.es.js +46 -0
  43. package/esm/locale/jv.mjs +46 -0
  44. package/esm/locale/ko.es.js +23 -0
  45. package/esm/locale/ko.mjs +23 -0
  46. package/esm/locale/my.es.js +38 -0
  47. package/esm/locale/my.mjs +38 -0
  48. package/esm/locale/nl.es.js +37 -0
  49. package/esm/locale/nl.mjs +37 -0
  50. package/esm/locale/pa-in.es.js +62 -0
  51. package/esm/locale/pa-in.mjs +62 -0
  52. package/esm/locale/pl.es.js +37 -0
  53. package/esm/locale/pl.mjs +37 -0
  54. package/esm/locale/pt.es.js +44 -0
  55. package/esm/locale/pt.mjs +44 -0
  56. package/esm/locale/ro.es.js +22 -0
  57. package/esm/locale/ro.mjs +22 -0
  58. package/esm/locale/ru.es.js +44 -0
  59. package/esm/locale/ru.mjs +44 -0
  60. package/esm/locale/rw.es.js +22 -0
  61. package/esm/locale/rw.mjs +22 -0
  62. package/esm/locale/sr.es.js +22 -0
  63. package/esm/locale/sr.mjs +22 -0
  64. package/esm/locale/th.es.js +23 -0
  65. package/esm/locale/th.mjs +23 -0
  66. package/esm/locale/tr.es.js +22 -0
  67. package/esm/locale/tr.mjs +22 -0
  68. package/esm/locale/uk.es.js +57 -0
  69. package/esm/locale/uk.mjs +57 -0
  70. package/esm/locale/uz.es.js +22 -0
  71. package/esm/locale/uz.mjs +22 -0
  72. package/esm/locale/vi.es.js +23 -0
  73. package/esm/locale/vi.mjs +23 -0
  74. package/esm/locale/zh-cn.es.js +48 -0
  75. package/esm/locale/zh-cn.mjs +48 -0
  76. package/esm/locale/zh-tw.es.js +46 -0
  77. package/esm/locale/zh-tw.mjs +46 -0
  78. package/esm/plugin/day-of-week.es.js +19 -0
  79. package/esm/plugin/day-of-week.mjs +19 -0
  80. package/esm/plugin/meridiem.es.js +47 -0
  81. package/esm/plugin/meridiem.mjs +47 -0
  82. package/esm/plugin/microsecond.es.js +31 -0
  83. package/esm/plugin/microsecond.mjs +31 -0
  84. package/esm/plugin/ordinal.es.js +34 -0
  85. package/esm/plugin/ordinal.mjs +34 -0
  86. package/esm/plugin/timespan.es.js +75 -0
  87. package/esm/plugin/timespan.mjs +75 -0
  88. package/esm/plugin/timezone.es.js +73 -0
  89. package/esm/plugin/timezone.mjs +73 -0
  90. package/esm/plugin/two-digit-year.es.js +21 -0
  91. package/esm/plugin/two-digit-year.mjs +21 -0
  92. package/locale/ar.js +14 -19
  93. package/locale/az.js +14 -19
  94. package/locale/bn.js +14 -19
  95. package/locale/cs.js +14 -19
  96. package/locale/de.js +15 -20
  97. package/locale/dk.js +15 -20
  98. package/locale/el.js +21 -24
  99. package/locale/en.js +17 -19
  100. package/locale/es.js +14 -19
  101. package/locale/fa.js +14 -19
  102. package/locale/fr.js +14 -19
  103. package/locale/hi.js +14 -19
  104. package/locale/hu.js +14 -19
  105. package/locale/id.js +14 -19
  106. package/locale/it.js +14 -19
  107. package/locale/ja.js +14 -19
  108. package/locale/jv.js +14 -19
  109. package/locale/ko.js +14 -19
  110. package/locale/my.js +14 -19
  111. package/locale/nl.js +20 -23
  112. package/locale/pa-in.js +14 -19
  113. package/locale/pl.js +20 -23
  114. package/locale/pt.js +14 -19
  115. package/locale/ro.js +15 -20
  116. package/locale/ru.js +14 -19
  117. package/locale/rw.js +30 -0
  118. package/locale/sr.js +14 -19
  119. package/locale/th.js +14 -19
  120. package/locale/tr.js +14 -19
  121. package/locale/uk.js +23 -26
  122. package/locale/uz.js +14 -19
  123. package/locale/vi.js +14 -19
  124. package/locale/zh-cn.js +14 -19
  125. package/locale/zh-tw.js +14 -19
  126. package/package.json +26 -11
  127. package/plugin/day-of-week.js +13 -14
  128. package/plugin/meridiem.js +32 -24
  129. package/plugin/microsecond.js +14 -15
  130. package/plugin/ordinal.js +13 -14
  131. package/plugin/timespan.js +13 -14
  132. package/plugin/timezone.js +81 -0
  133. package/plugin/two-digit-year.js +13 -19
@@ -0,0 +1,75 @@
1
+ /**
2
+ * @preserve date-and-time.js plugin
3
+ * @preserve timespan
4
+ */
5
+
6
+ var plugin = function (date) {
7
+ var timeSpan = function (date1, date2) {
8
+ var milliseconds = function (dt, time) {
9
+ dt.S = time;
10
+ return dt;
11
+ },
12
+ seconds = function (dt, time) {
13
+ dt.s = time / 1000 | 0;
14
+ return milliseconds(dt, Math.abs(time) % 1000);
15
+ },
16
+ minutes = function (dt, time) {
17
+ dt.m = time / 60000 | 0;
18
+ return seconds(dt, Math.abs(time) % 60000);
19
+ },
20
+ hours = function (dt, time) {
21
+ dt.H = time / 3600000 | 0;
22
+ return minutes(dt, Math.abs(time) % 3600000);
23
+ },
24
+ days = function (dt, time) {
25
+ dt.D = time / 86400000 | 0;
26
+ return hours(dt, Math.abs(time) % 86400000);
27
+ },
28
+ format = function (dt, formatString) {
29
+ var pattern = date.compile(formatString);
30
+ var str = '';
31
+
32
+ for (var i = 1, len = pattern.length, token, value; i < len; i++) {
33
+ token = pattern[i].charAt(0);
34
+ if (token in dt) {
35
+ value = '' + Math.abs(dt[token]);
36
+ while (value.length < pattern[i].length) {
37
+ value = '0' + value;
38
+ }
39
+ if (dt[token] < 0) {
40
+ value = '-' + value;
41
+ }
42
+ str += value;
43
+ } else {
44
+ str += pattern[i].replace(/\[(.*)]/, '$1');
45
+ }
46
+ }
47
+ return str;
48
+ },
49
+ delta = date1.getTime() - date2.getTime();
50
+
51
+ return {
52
+ toMilliseconds: function (formatString) {
53
+ return format(milliseconds({}, delta), formatString);
54
+ },
55
+ toSeconds: function (formatString) {
56
+ return format(seconds({}, delta), formatString);
57
+ },
58
+ toMinutes: function (formatString) {
59
+ return format(minutes({}, delta), formatString);
60
+ },
61
+ toHours: function (formatString) {
62
+ return format(hours({}, delta), formatString);
63
+ },
64
+ toDays: function (formatString) {
65
+ return format(days({}, delta), formatString);
66
+ }
67
+ };
68
+ };
69
+ var name = 'timespan';
70
+
71
+ date.plugin(name, { extender: { timeSpan: timeSpan } });
72
+ return name;
73
+ };
74
+
75
+ export { plugin as default };
@@ -0,0 +1,75 @@
1
+ /**
2
+ * @preserve date-and-time.js plugin
3
+ * @preserve timespan
4
+ */
5
+
6
+ var plugin = function (date) {
7
+ var timeSpan = function (date1, date2) {
8
+ var milliseconds = function (dt, time) {
9
+ dt.S = time;
10
+ return dt;
11
+ },
12
+ seconds = function (dt, time) {
13
+ dt.s = time / 1000 | 0;
14
+ return milliseconds(dt, Math.abs(time) % 1000);
15
+ },
16
+ minutes = function (dt, time) {
17
+ dt.m = time / 60000 | 0;
18
+ return seconds(dt, Math.abs(time) % 60000);
19
+ },
20
+ hours = function (dt, time) {
21
+ dt.H = time / 3600000 | 0;
22
+ return minutes(dt, Math.abs(time) % 3600000);
23
+ },
24
+ days = function (dt, time) {
25
+ dt.D = time / 86400000 | 0;
26
+ return hours(dt, Math.abs(time) % 86400000);
27
+ },
28
+ format = function (dt, formatString) {
29
+ var pattern = date.compile(formatString);
30
+ var str = '';
31
+
32
+ for (var i = 1, len = pattern.length, token, value; i < len; i++) {
33
+ token = pattern[i].charAt(0);
34
+ if (token in dt) {
35
+ value = '' + Math.abs(dt[token]);
36
+ while (value.length < pattern[i].length) {
37
+ value = '0' + value;
38
+ }
39
+ if (dt[token] < 0) {
40
+ value = '-' + value;
41
+ }
42
+ str += value;
43
+ } else {
44
+ str += pattern[i].replace(/\[(.*)]/, '$1');
45
+ }
46
+ }
47
+ return str;
48
+ },
49
+ delta = date1.getTime() - date2.getTime();
50
+
51
+ return {
52
+ toMilliseconds: function (formatString) {
53
+ return format(milliseconds({}, delta), formatString);
54
+ },
55
+ toSeconds: function (formatString) {
56
+ return format(seconds({}, delta), formatString);
57
+ },
58
+ toMinutes: function (formatString) {
59
+ return format(minutes({}, delta), formatString);
60
+ },
61
+ toHours: function (formatString) {
62
+ return format(hours({}, delta), formatString);
63
+ },
64
+ toDays: function (formatString) {
65
+ return format(days({}, delta), formatString);
66
+ }
67
+ };
68
+ };
69
+ var name = 'timespan';
70
+
71
+ date.plugin(name, { extender: { timeSpan: timeSpan } });
72
+ return name;
73
+ };
74
+
75
+ export { plugin as default };
@@ -0,0 +1,73 @@
1
+ /**
2
+ * @preserve date-and-time.js plugin
3
+ * @preserve timezone
4
+ */
5
+
6
+ var plugin = function (date, localized_date) {
7
+ var options = {
8
+ year: 'numeric', month: 'numeric', day: 'numeric',
9
+ hour: 'numeric', minute: 'numeric', second: 'numeric'
10
+ };
11
+ var pattern = date.compile('M/D/Y, h:mm:ss A');
12
+ var formatTZ = function (dateObj, arg, timeZone) {
13
+ options.timeZone = 'UTC';
14
+ var utcObj = date.parse(new Intl.DateTimeFormat('en-US', options).format(dateObj), pattern);
15
+
16
+ options.timeZone = timeZone;
17
+ var dateObj2 = date.parse(new Intl.DateTimeFormat('en-US', options).format(dateObj), pattern);
18
+
19
+ var dateObj3 = date.addMilliseconds(dateObj2, dateObj.getMilliseconds());
20
+
21
+ dateObj3.getTimezoneOffset = function () { return (utcObj.getTime() - dateObj2.getTime()) / 60000 | 0; };
22
+ return localized_date.format(dateObj3, arg);
23
+ };
24
+ var adjustments = [
25
+ -60, -30, -20,
26
+ 0,
27
+ 60, 30, 20
28
+ ];
29
+ var parseTZ = function (dateString, arg, timeZone) {
30
+ var pattern2 = typeof arg === 'string' ? date.compile(arg) : arg;
31
+ var dateObj = localized_date.parse(dateString, pattern2, true);
32
+
33
+ for (var i = 1, len = pattern2.length; i < len; i++) {
34
+ if (pattern2[i].indexOf('Z') === 0) {
35
+ return dateObj;
36
+ }
37
+ }
38
+
39
+ options.timeZone = timeZone;
40
+ var dateTimeFormat = new Intl.DateTimeFormat('en-US', options);
41
+ var dateObj2 = date.addMilliseconds(
42
+ date.parse(dateTimeFormat.format(dateObj), pattern, true),
43
+ dateObj.getMilliseconds()
44
+ );
45
+ var offset = dateObj.getTime() - dateObj2.getTime();
46
+ var dateString2 = date.format(localized_date.parse(dateString, pattern2), pattern);
47
+
48
+ var comparer = function (d) {
49
+ return dateString2 === dateTimeFormat.format(d);
50
+ };
51
+
52
+ // Trying to adjust for daylight saving time.
53
+ for (var j = 0, len2 = adjustments.length; j < len2; j++) {
54
+ var d = date.addMilliseconds(dateObj, offset + adjustments[j] * 60000);
55
+ if (comparer(d)) {
56
+ return d;
57
+ }
58
+ }
59
+ return NaN;
60
+ };
61
+
62
+ var name = 'timezone';
63
+
64
+ date.plugin(name, {
65
+ extender: {
66
+ formatTZ: formatTZ,
67
+ parseTZ: parseTZ
68
+ }
69
+ });
70
+ return name;
71
+ };
72
+
73
+ export { plugin as default };
@@ -0,0 +1,73 @@
1
+ /**
2
+ * @preserve date-and-time.js plugin
3
+ * @preserve timezone
4
+ */
5
+
6
+ var plugin = function (date, localized_date) {
7
+ var options = {
8
+ year: 'numeric', month: 'numeric', day: 'numeric',
9
+ hour: 'numeric', minute: 'numeric', second: 'numeric'
10
+ };
11
+ var pattern = date.compile('M/D/Y, h:mm:ss A');
12
+ var formatTZ = function (dateObj, arg, timeZone) {
13
+ options.timeZone = 'UTC';
14
+ var utcObj = date.parse(new Intl.DateTimeFormat('en-US', options).format(dateObj), pattern);
15
+
16
+ options.timeZone = timeZone;
17
+ var dateObj2 = date.parse(new Intl.DateTimeFormat('en-US', options).format(dateObj), pattern);
18
+
19
+ var dateObj3 = date.addMilliseconds(dateObj2, dateObj.getMilliseconds());
20
+
21
+ dateObj3.getTimezoneOffset = function () { return (utcObj.getTime() - dateObj2.getTime()) / 60000 | 0; };
22
+ return localized_date.format(dateObj3, arg);
23
+ };
24
+ var adjustments = [
25
+ -60, -30, -20,
26
+ 0,
27
+ 60, 30, 20
28
+ ];
29
+ var parseTZ = function (dateString, arg, timeZone) {
30
+ var pattern2 = typeof arg === 'string' ? date.compile(arg) : arg;
31
+ var dateObj = localized_date.parse(dateString, pattern2, true);
32
+
33
+ for (var i = 1, len = pattern2.length; i < len; i++) {
34
+ if (pattern2[i].indexOf('Z') === 0) {
35
+ return dateObj;
36
+ }
37
+ }
38
+
39
+ options.timeZone = timeZone;
40
+ var dateTimeFormat = new Intl.DateTimeFormat('en-US', options);
41
+ var dateObj2 = date.addMilliseconds(
42
+ date.parse(dateTimeFormat.format(dateObj), pattern, true),
43
+ dateObj.getMilliseconds()
44
+ );
45
+ var offset = dateObj.getTime() - dateObj2.getTime();
46
+ var dateString2 = date.format(localized_date.parse(dateString, pattern2), pattern);
47
+
48
+ var comparer = function (d) {
49
+ return dateString2 === dateTimeFormat.format(d);
50
+ };
51
+
52
+ // Trying to adjust for daylight saving time.
53
+ for (var j = 0, len2 = adjustments.length; j < len2; j++) {
54
+ var d = date.addMilliseconds(dateObj, offset + adjustments[j] * 60000);
55
+ if (comparer(d)) {
56
+ return d;
57
+ }
58
+ }
59
+ return NaN;
60
+ };
61
+
62
+ var name = 'timezone';
63
+
64
+ date.plugin(name, {
65
+ extender: {
66
+ formatTZ: formatTZ,
67
+ parseTZ: parseTZ
68
+ }
69
+ });
70
+ return name;
71
+ };
72
+
73
+ export { plugin as default };
@@ -0,0 +1,21 @@
1
+ /**
2
+ * @preserve date-and-time.js plugin
3
+ * @preserve two-digit-year
4
+ */
5
+
6
+ var plugin = function (date) {
7
+ var name = 'two-digit-year';
8
+
9
+ date.plugin(name, {
10
+ parser: {
11
+ YY: function (str) {
12
+ var result = this.exec(/^\d\d/, str);
13
+ result.value += result.value < 70 ? 2000 : 1900;
14
+ return result;
15
+ }
16
+ }
17
+ });
18
+ return name;
19
+ };
20
+
21
+ export { plugin as default };
@@ -0,0 +1,21 @@
1
+ /**
2
+ * @preserve date-and-time.js plugin
3
+ * @preserve two-digit-year
4
+ */
5
+
6
+ var plugin = function (date) {
7
+ var name = 'two-digit-year';
8
+
9
+ date.plugin(name, {
10
+ parser: {
11
+ YY: function (str) {
12
+ var result = this.exec(/^\d\d/, str);
13
+ result.value += result.value < 70 ? 2000 : 1900;
14
+ return result;
15
+ }
16
+ }
17
+ });
18
+ return name;
19
+ };
20
+
21
+ export { plugin as default };
package/locale/ar.js CHANGED
@@ -1,12 +1,16 @@
1
- /**
2
- * @preserve date-and-time.js locale configuration
3
- * @preserve Arabic (ar)
4
- * @preserve It is using moment.js locale configuration as a reference.
5
- */
6
- (function (global) {
7
- 'use strict';
1
+ (function (global, factory) {
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
3
+ typeof define === 'function' && define.amd ? define(factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, (global.date = global.date || {}, global.date.locale = global.date.locale || {}, global.date.locale.ar = factory()));
5
+ })(this, (function () { 'use strict';
8
6
 
9
- var exec = function (date) {
7
+ /**
8
+ * @preserve date-and-time.js locale configuration
9
+ * @preserve Arabic (ar)
10
+ * @preserve It is using moment.js locale configuration as a reference.
11
+ */
12
+
13
+ var ar = function (date) {
10
14
  var code = 'ar';
11
15
 
12
16
  date.locale(code, {
@@ -38,15 +42,6 @@
38
42
  return code;
39
43
  };
40
44
 
41
- if (typeof module === 'object' && typeof module.exports === 'object') {
42
- (module.paths || []).push('./');
43
- module.exports = exec;
44
- // This line will be removed in the next version.
45
- exec(require('date-and-time'));
46
- } else if (typeof define === 'function' && define.amd) {
47
- define(['date-and-time'], exec);
48
- } else {
49
- exec(global.date);
50
- }
45
+ return ar;
51
46
 
52
- }(this));
47
+ }));
package/locale/az.js CHANGED
@@ -1,12 +1,16 @@
1
- /**
2
- * @preserve date-and-time.js locale configuration
3
- * @preserve Azerbaijani (az)
4
- * @preserve It is using moment.js locale configuration as a reference.
5
- */
6
- (function (global) {
7
- 'use strict';
1
+ (function (global, factory) {
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
3
+ typeof define === 'function' && define.amd ? define(factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, (global.date = global.date || {}, global.date.locale = global.date.locale || {}, global.date.locale.az = factory()));
5
+ })(this, (function () { 'use strict';
8
6
 
9
- var exec = function (date) {
7
+ /**
8
+ * @preserve date-and-time.js locale configuration
9
+ * @preserve Azerbaijani (az)
10
+ * @preserve It is using moment.js locale configuration as a reference.
11
+ */
12
+
13
+ var az = function (date) {
10
14
  var code = 'az';
11
15
 
12
16
  date.locale(code, {
@@ -43,15 +47,6 @@
43
47
  return code;
44
48
  };
45
49
 
46
- if (typeof module === 'object' && typeof module.exports === 'object') {
47
- (module.paths || []).push('./');
48
- module.exports = exec;
49
- // This line will be removed in the next version.
50
- exec(require('date-and-time'));
51
- } else if (typeof define === 'function' && define.amd) {
52
- define(['date-and-time'], exec);
53
- } else {
54
- exec(global.date);
55
- }
50
+ return az;
56
51
 
57
- }(this));
52
+ }));
package/locale/bn.js CHANGED
@@ -1,12 +1,16 @@
1
- /**
2
- * @preserve date-and-time.js locale configuration
3
- * @preserve Bengali (bn)
4
- * @preserve It is using moment.js locale configuration as a reference.
5
- */
6
- (function (global) {
7
- 'use strict';
1
+ (function (global, factory) {
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
3
+ typeof define === 'function' && define.amd ? define(factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, (global.date = global.date || {}, global.date.locale = global.date.locale || {}, global.date.locale.bn = factory()));
5
+ })(this, (function () { 'use strict';
8
6
 
9
- var exec = function (date) {
7
+ /**
8
+ * @preserve date-and-time.js locale configuration
9
+ * @preserve Bengali (bn)
10
+ * @preserve It is using moment.js locale configuration as a reference.
11
+ */
12
+
13
+ var bn = function (date) {
10
14
  var code = 'bn';
11
15
 
12
16
  date.locale(code, {
@@ -49,15 +53,6 @@
49
53
  return code;
50
54
  };
51
55
 
52
- if (typeof module === 'object' && typeof module.exports === 'object') {
53
- (module.paths || []).push('./');
54
- module.exports = exec;
55
- // This line will be removed in the next version.
56
- exec(require('date-and-time'));
57
- } else if (typeof define === 'function' && define.amd) {
58
- define(['date-and-time'], exec);
59
- } else {
60
- exec(global.date);
61
- }
56
+ return bn;
62
57
 
63
- }(this));
58
+ }));
package/locale/cs.js CHANGED
@@ -1,12 +1,16 @@
1
- /**
2
- * @preserve date-and-time.js locale configuration
3
- * @preserve Czech (cs)
4
- * @preserve It is using moment.js locale configuration as a reference.
5
- */
6
- (function (global) {
7
- 'use strict';
1
+ (function (global, factory) {
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
3
+ typeof define === 'function' && define.amd ? define(factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, (global.date = global.date || {}, global.date.locale = global.date.locale || {}, global.date.locale.cs = factory()));
5
+ })(this, (function () { 'use strict';
8
6
 
9
- var exec = function (date) {
7
+ /**
8
+ * @preserve date-and-time.js locale configuration
9
+ * @preserve Czech (cs)
10
+ * @preserve It is using moment.js locale configuration as a reference.
11
+ */
12
+
13
+ var cs = function (date) {
10
14
  var code = 'cs';
11
15
 
12
16
  date.locale(code, {
@@ -21,15 +25,6 @@
21
25
  return code;
22
26
  };
23
27
 
24
- if (typeof module === 'object' && typeof module.exports === 'object') {
25
- (module.paths || []).push('./');
26
- module.exports = exec;
27
- // This line will be removed in the next version.
28
- exec(require('date-and-time'));
29
- } else if (typeof define === 'function' && define.amd) {
30
- define(['date-and-time'], exec);
31
- } else {
32
- exec(global.date);
33
- }
28
+ return cs;
34
29
 
35
- }(this));
30
+ }));
package/locale/de.js CHANGED
@@ -1,15 +1,19 @@
1
- /**
2
- * @preserve date-and-time.js locale configuration
3
- * @preserve German (de)
4
- * @preserve It is using moment.js locale configuration as a reference.
5
- */
6
- (function (global) {
7
- 'use strict';
1
+ (function (global, factory) {
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
3
+ typeof define === 'function' && define.amd ? define(factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, (global.date = global.date || {}, global.date.locale = global.date.locale || {}, global.date.locale.de = factory()));
5
+ })(this, (function () { 'use strict';
8
6
 
9
- var exec = function (date) {
7
+ /**
8
+ * @preserve date-and-time.js locale configuration
9
+ * @preserve German (de)
10
+ * @preserve It is using moment.js locale configuration as a reference.
11
+ */
12
+
13
+ var de = function (date) {
10
14
  var code = 'de';
11
15
 
12
- date.locale('de', {
16
+ date.locale(code, {
13
17
  res: {
14
18
  MMMM: ['Januar', 'Februar', 'März', 'April', 'Mai', 'Juni', 'Juli', 'August', 'September', 'Oktober', 'November', 'Dezember'],
15
19
  MMM: ['Jan.', 'Febr.', 'Mrz.', 'Apr.', 'Mai', 'Jun.', 'Jul.', 'Aug.', 'Sept.', 'Okt.', 'Nov.', 'Dez.'],
@@ -22,15 +26,6 @@
22
26
  return code;
23
27
  };
24
28
 
25
- if (typeof module === 'object' && typeof module.exports === 'object') {
26
- (module.paths || []).push('./');
27
- module.exports = exec;
28
- // This line will be removed in the next version.
29
- exec(require('date-and-time'));
30
- } else if (typeof define === 'function' && define.amd) {
31
- define(['date-and-time'], exec);
32
- } else {
33
- exec(global.date);
34
- }
29
+ return de;
35
30
 
36
- }(this));
31
+ }));
package/locale/dk.js CHANGED
@@ -1,15 +1,19 @@
1
- /**
2
- * @preserve date-and-time.js locale configuration
3
- * @preserve Danish (DK)
4
- * @preserve It is using moment.js locale configuration as a reference.
5
- */
6
- (function (global) {
7
- 'use strict';
1
+ (function (global, factory) {
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
3
+ typeof define === 'function' && define.amd ? define(factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, (global.date = global.date || {}, global.date.locale = global.date.locale || {}, global.date.locale.dk = factory()));
5
+ })(this, (function () { 'use strict';
8
6
 
9
- var exec = function (date) {
7
+ /**
8
+ * @preserve date-and-time.js locale configuration
9
+ * @preserve Danish (DK)
10
+ * @preserve It is using moment.js locale configuration as a reference.
11
+ */
12
+
13
+ var dk = function (date) {
10
14
  var code = 'dk';
11
15
 
12
- date.locale('dk', {
16
+ date.locale(code, {
13
17
  res: {
14
18
  MMMM: ['januar', 'februar', 'marts', 'april', 'maj', 'juni', 'juli', 'august', 'september', 'oktober', 'november', 'december'],
15
19
  MMM: ['jan', 'feb', 'mar', 'apr', 'maj', 'jun', 'jul', 'aug', 'sep', 'okt', 'nov', 'dec'],
@@ -21,15 +25,6 @@
21
25
  return code;
22
26
  };
23
27
 
24
- if (typeof module === 'object' && typeof module.exports === 'object') {
25
- (module.paths || []).push('./');
26
- module.exports = exec;
27
- // This line will be removed in the next version.
28
- exec(require('date-and-time'));
29
- } else if (typeof define === 'function' && define.amd) {
30
- define(['date-and-time'], exec);
31
- } else {
32
- exec(global.date);
33
- }
28
+ return dk;
34
29
 
35
- }(this));
30
+ }));