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
package/locale/nl.js CHANGED
@@ -1,31 +1,37 @@
1
- /**
2
- * @preserve date-and-time.js locale configuration
3
- * @preserve Dutch (nl)
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.nl = factory()));
5
+ })(this, (function () { 'use strict';
8
6
 
9
- var exec = function (date) {
7
+ /**
8
+ * @preserve date-and-time.js locale configuration
9
+ * @preserve Dutch (nl)
10
+ * @preserve It is using moment.js locale configuration as a reference.
11
+ */
12
+
13
+ var nl = function (date) {
10
14
  var code = 'nl';
11
15
 
12
16
  date.locale(code, {
13
17
  res: {
14
18
  MMMM: ['januari', 'februari', 'maart', 'april', 'mei', 'juni', 'juli', 'augustus', 'september', 'oktober', 'november', 'december'],
15
- MMM_withdots: ['jan.', 'feb.', 'mrt.', 'apr.', 'mei', 'jun.', 'jul.', 'aug.', 'sep.', 'okt.', 'nov.', 'dec.'],
16
- MMM_withoutdots: ['jan', 'feb', 'mrt', 'apr', 'mei', 'jun', 'jul', 'aug', 'sep', 'okt', 'nov', 'dec'],
19
+ MMM: [
20
+ ['jan.', 'feb.', 'mrt.', 'apr.', 'mei', 'jun.', 'jul.', 'aug.', 'sep.', 'okt.', 'nov.', 'dec.'],
21
+ ['jan', 'feb', 'mrt', 'apr', 'mei', 'jun', 'jul', 'aug', 'sep', 'okt', 'nov', 'dec']
22
+ ],
17
23
  dddd: ['zondag', 'maandag', 'dinsdag', 'woensdag', 'donderdag', 'vrijdag', 'zaterdag'],
18
24
  ddd: ['zo.', 'ma.', 'di.', 'wo.', 'do.', 'vr.', 'za.'],
19
25
  dd: ['Zo', 'Ma', 'Di', 'Wo', 'Do', 'Vr', 'Za']
20
26
  },
21
27
  formatter: {
22
28
  MMM: function (d, formatString) {
23
- return this.res['MMM_' + (/-MMM-/.test(formatString) ? 'withoutdots' : 'withdots')][d.getMonth()];
29
+ return this.res.MMM[/-MMM-/.test(formatString) | 0][d.getMonth()];
24
30
  }
25
31
  },
26
32
  parser: {
27
33
  MMM: function (str, formatString) {
28
- var result = this.find(this.res['MMM_' + (/-MMM-/.test(formatString) ? 'withoutdots' : 'withdots')], str);
34
+ var result = this.find(this.res.MMM[/-MMM-/.test(formatString) | 0], str);
29
35
  result.value++;
30
36
  return result;
31
37
  }
@@ -34,15 +40,6 @@
34
40
  return code;
35
41
  };
36
42
 
37
- if (typeof module === 'object' && typeof module.exports === 'object') {
38
- (module.paths || []).push('./');
39
- module.exports = exec;
40
- // This line will be removed in the next version.
41
- exec(require('date-and-time'));
42
- } else if (typeof define === 'function' && define.amd) {
43
- define(['date-and-time'], exec);
44
- } else {
45
- exec(global.date);
46
- }
43
+ return nl;
47
44
 
48
- }(this));
45
+ }));
package/locale/pa-in.js CHANGED
@@ -1,12 +1,16 @@
1
- /**
2
- * @preserve date-and-time.js locale configuration
3
- * @preserve Punjabi (pa-in)
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["pa-in"] = factory()));
5
+ })(this, (function () { 'use strict';
8
6
 
9
- var exec = function (date) {
7
+ /**
8
+ * @preserve date-and-time.js locale configuration
9
+ * @preserve Punjabi (pa-in)
10
+ * @preserve It is using moment.js locale configuration as a reference.
11
+ */
12
+
13
+ var pa_in = function (date) {
10
14
  var code = 'pa-in';
11
15
 
12
16
  date.locale(code, {
@@ -61,15 +65,6 @@
61
65
  return code;
62
66
  };
63
67
 
64
- if (typeof module === 'object' && typeof module.exports === 'object') {
65
- (module.paths || []).push('./');
66
- module.exports = exec;
67
- // This line will be removed in the next version.
68
- exec(require('date-and-time'));
69
- } else if (typeof define === 'function' && define.amd) {
70
- define(['date-and-time'], exec);
71
- } else {
72
- exec(global.date);
73
- }
68
+ return pa_in;
74
69
 
75
- }(this));
70
+ }));
package/locale/pl.js CHANGED
@@ -1,18 +1,24 @@
1
- /**
2
- * @preserve date-and-time.js locale configuration
3
- * @preserve Polish (pl)
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.pl = factory()));
5
+ })(this, (function () { 'use strict';
8
6
 
9
- var exec = function (date) {
7
+ /**
8
+ * @preserve date-and-time.js locale configuration
9
+ * @preserve Polish (pl)
10
+ * @preserve It is using moment.js locale configuration as a reference.
11
+ */
12
+
13
+ var pl = function (date) {
10
14
  var code = 'pl';
11
15
 
12
16
  date.locale(code, {
13
17
  res: {
14
- MMMM_nominative: ['styczeń', 'luty', 'marzec', 'kwiecień', 'maj', 'czerwiec', 'lipiec', 'sierpień', 'wrzesień', 'październik', 'listopad', 'grudzień'],
15
- MMMM_subjective: ['stycznia', 'lutego', 'marca', 'kwietnia', 'maja', 'czerwca', 'lipca', 'sierpnia', 'września', 'października', 'listopada', 'grudnia'],
18
+ MMMM: [
19
+ ['styczeń', 'luty', 'marzec', 'kwiecień', 'maj', 'czerwiec', 'lipiec', 'sierpień', 'wrzesień', 'październik', 'listopad', 'grudzień'],
20
+ ['stycznia', 'lutego', 'marca', 'kwietnia', 'maja', 'czerwca', 'lipca', 'sierpnia', 'września', 'października', 'listopada', 'grudnia']
21
+ ],
16
22
  MMM: ['sty', 'lut', 'mar', 'kwi', 'maj', 'cze', 'lip', 'sie', 'wrz', 'paź', 'lis', 'gru'],
17
23
  dddd: ['niedziela', 'poniedziałek', 'wtorek', 'środa', 'czwartek', 'piątek', 'sobota'],
18
24
  ddd: ['nie', 'pon', 'wt', 'śr', 'czw', 'pt', 'sb'],
@@ -20,12 +26,12 @@
20
26
  },
21
27
  formatter: {
22
28
  MMMM: function (d, formatString) {
23
- return this.res['MMMM_' + (/D MMMM/.test(formatString) ? 'subjective' : 'nominative')][d.getMonth()];
29
+ return this.res.MMMM[/D MMMM/.test(formatString) | 0][d.getMonth()];
24
30
  }
25
31
  },
26
32
  parser: {
27
33
  MMMM: function (str, formatString) {
28
- var result = this.find(this.res['MMMM_' + (/D MMMM/.test(formatString) ? 'subjective' : 'nominative')], str);
34
+ var result = this.find(this.res.MMMM[/D MMMM/.test(formatString) | 0], str);
29
35
  result.value++;
30
36
  return result;
31
37
  }
@@ -34,15 +40,6 @@
34
40
  return code;
35
41
  };
36
42
 
37
- if (typeof module === 'object' && typeof module.exports === 'object') {
38
- (module.paths || []).push('./');
39
- module.exports = exec;
40
- // This line will be removed in the next version.
41
- exec(require('date-and-time'));
42
- } else if (typeof define === 'function' && define.amd) {
43
- define(['date-and-time'], exec);
44
- } else {
45
- exec(global.date);
46
- }
43
+ return pl;
47
44
 
48
- }(this));
45
+ }));
package/locale/pt.js CHANGED
@@ -1,12 +1,16 @@
1
- /**
2
- * @preserve date-and-time.js locale configuration
3
- * @preserve Portuguese (pt)
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.pt = factory()));
5
+ })(this, (function () { 'use strict';
8
6
 
9
- var exec = function (date) {
7
+ /**
8
+ * @preserve date-and-time.js locale configuration
9
+ * @preserve Portuguese (pt)
10
+ * @preserve It is using moment.js locale configuration as a reference.
11
+ */
12
+
13
+ var pt = function (date) {
10
14
  var code = 'pt';
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 pt;
56
51
 
57
- }(this));
52
+ }));
package/locale/ro.js CHANGED
@@ -1,15 +1,19 @@
1
- /**
2
- * @preserve date-and-time.js locale configuration
3
- * @preserve Romanian (ro)
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.ro = factory()));
5
+ })(this, (function () { 'use strict';
8
6
 
9
- var exec = function (date) {
7
+ /**
8
+ * @preserve date-and-time.js locale configuration
9
+ * @preserve Romanian (ro)
10
+ * @preserve It is using moment.js locale configuration as a reference.
11
+ */
12
+
13
+ var ro = function (date) {
10
14
  var code = 'ro';
11
15
 
12
- date.locale('ro', {
16
+ date.locale(code, {
13
17
  res: {
14
18
  MMMM: ['ianuarie', 'februarie', 'martie', 'aprilie', 'mai', 'iunie', 'iulie', 'august', 'septembrie', 'octombrie', 'noiembrie', 'decembrie'],
15
19
  MMM: ['ian.', 'febr.', 'mart.', 'apr.', 'mai', 'iun.', 'iul.', 'aug.', 'sept.', 'oct.', '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 ro;
34
29
 
35
- }(this));
30
+ }));
package/locale/ru.js CHANGED
@@ -1,12 +1,16 @@
1
- /**
2
- * @preserve date-and-time.js locale configuration
3
- * @preserve Russian (ru)
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.ru = factory()));
5
+ })(this, (function () { 'use strict';
8
6
 
9
- var exec = function (date) {
7
+ /**
8
+ * @preserve date-and-time.js locale configuration
9
+ * @preserve Russian (ru)
10
+ * @preserve It is using moment.js locale configuration as a reference.
11
+ */
12
+
13
+ var ru = function (date) {
10
14
  var code = 'ru';
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 ru;
56
51
 
57
- }(this));
52
+ }));
package/locale/rw.js ADDED
@@ -0,0 +1,30 @@
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.rw = factory()));
5
+ })(this, (function () { 'use strict';
6
+
7
+ /**
8
+ * @preserve date-and-time.js locale configuration
9
+ * @preserve Kinyarwanda (rw)
10
+ * @preserve It is using moment.js locale configuration as a reference.
11
+ */
12
+
13
+ var rw = function (date) {
14
+ var code = 'rw';
15
+
16
+ date.locale(code, {
17
+ res: {
18
+ MMMM: ['Mutarama', 'Gashyantare', 'Werurwe', 'Mata', 'Gicurasi', 'Kamena', 'Nyakanga', 'Kanama', 'Nzeri', 'Ukwakira', 'Ugushyingo', 'Ukuboza'],
19
+ MMM: ['Mtr', 'Gas', 'Wer', 'Mta', 'Gic', 'Kmn', 'Nyk', 'Knm', 'Nze', 'Ukw', 'Ugu', 'Uku'],
20
+ dddd: ['Ku cyumweru', 'Ku wambere', 'Ku wakabiri', 'Ku wagatatu', 'Ku wakane', 'Ku wagatanu', 'Ku wagatandatu'],
21
+ ddd: ['Cyu', 'Mbe', 'Kbr', 'Gtt', 'Kne', 'Gtn', 'Gtd'],
22
+ dd: ['Cy', 'Mb', 'Kb', 'Gt', 'Kn', 'Gn', 'Gd']
23
+ }
24
+ });
25
+ return code;
26
+ };
27
+
28
+ return rw;
29
+
30
+ }));
package/locale/sr.js CHANGED
@@ -1,12 +1,16 @@
1
- /**
2
- * @preserve date-and-time.js locale configuration
3
- * @preserve Serbian (sr)
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.sr = factory()));
5
+ })(this, (function () { 'use strict';
8
6
 
9
- var exec = function (date) {
7
+ /**
8
+ * @preserve date-and-time.js locale configuration
9
+ * @preserve Serbian (sr)
10
+ * @preserve It is using moment.js locale configuration as a reference.
11
+ */
12
+
13
+ var sr = function (date) {
10
14
  var code = 'sr';
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 sr;
34
29
 
35
- }(this));
30
+ }));
package/locale/th.js CHANGED
@@ -1,12 +1,16 @@
1
- /**
2
- * @preserve date-and-time.js locale configuration
3
- * @preserve Thai (th)
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.th = factory()));
5
+ })(this, (function () { 'use strict';
8
6
 
9
- var exec = function (date) {
7
+ /**
8
+ * @preserve date-and-time.js locale configuration
9
+ * @preserve Thai (th)
10
+ * @preserve It is using moment.js locale configuration as a reference.
11
+ */
12
+
13
+ var th = function (date) {
10
14
  var code = 'th';
11
15
 
12
16
  date.locale(code, {
@@ -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 th;
35
30
 
36
- }(this));
31
+ }));
package/locale/tr.js CHANGED
@@ -1,12 +1,16 @@
1
- /**
2
- * @preserve date-and-time.js locale configuration
3
- * @preserve Turkish (tr)
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.tr = factory()));
5
+ })(this, (function () { 'use strict';
8
6
 
9
- var exec = function (date) {
7
+ /**
8
+ * @preserve date-and-time.js locale configuration
9
+ * @preserve Turkish (tr)
10
+ * @preserve It is using moment.js locale configuration as a reference.
11
+ */
12
+
13
+ var tr = function (date) {
10
14
  var code = 'tr';
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 tr;
34
29
 
35
- }(this));
30
+ }));
package/locale/uk.js CHANGED
@@ -1,21 +1,27 @@
1
- /**
2
- * @preserve date-and-time.js locale configuration
3
- * @preserve Ukrainian (uk)
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.uk = factory()));
5
+ })(this, (function () { 'use strict';
8
6
 
9
- var exec = function (date) {
7
+ /**
8
+ * @preserve date-and-time.js locale configuration
9
+ * @preserve Ukrainian (uk)
10
+ * @preserve It is using moment.js locale configuration as a reference.
11
+ */
12
+
13
+ var uk = function (date) {
10
14
  var code = 'uk';
11
15
 
12
16
  date.locale(code, {
13
17
  res: {
14
18
  MMMM: ['січня', 'лютого', 'березня', 'квітня', 'травня', 'червня', 'липня', 'серпня', 'вересня', 'жовтня', 'листопада', 'грудня'],
15
19
  MMM: ['січ', 'лют', 'бер', 'квіт', 'трав', 'черв', 'лип', 'серп', 'вер', 'жовт', 'лист', 'груд'],
16
- dddd_nominative: ['неділя', 'понеділок', 'вівторок', 'середа', 'четвер', 'п’ятниця', 'субота'],
17
- dddd_accusative: ['неділю', 'понеділок', 'вівторок', 'середу', 'четвер', 'п’ятницю', 'суботу'],
18
- dddd_genitive: ['неділі', 'понеділка', 'вівторка', 'середи', 'четверга', 'п’ятниці', 'суботи'],
20
+ dddd: [
21
+ ['неділя', 'понеділок', 'вівторок', 'середа', 'четвер', 'п’ятниця', 'субота'],
22
+ ['неділю', 'понеділок', 'вівторок', 'середу', 'четвер', 'п’ятницю', 'суботу'],
23
+ ['неділі', 'понеділка', 'вівторка', 'середи', 'четверга', 'п’ятниці', 'суботи']
24
+ ],
19
25
  ddd: ['нд', 'пн', 'вт', 'ср', 'чт', 'пт', 'сб'],
20
26
  dd: ['нд', 'пн', 'вт', 'ср', 'чт', 'пт', 'сб'],
21
27
  A: ['ночі', 'ранку', 'дня', 'вечора']
@@ -33,13 +39,13 @@
33
39
  return this.res.A[3]; // вечора
34
40
  },
35
41
  dddd: function (d, formatString) {
36
- var type = 'nominative';
42
+ var type = 0;
37
43
  if (/(\[[ВвУу]\]) ?dddd/.test(formatString)) {
38
- type = 'accusative';
44
+ type = 1;
39
45
  } else if (/\[?(?:минулої|наступної)? ?\] ?dddd/.test(formatString)) {
40
- type = 'genitive';
46
+ type = 2;
41
47
  }
42
- return this.res['dddd_' + type][d.getDay()];
48
+ return this.res.dddd[type][d.getDay()];
43
49
  }
44
50
  },
45
51
  parser: {
@@ -54,15 +60,6 @@
54
60
  return code;
55
61
  };
56
62
 
57
- if (typeof module === 'object' && typeof module.exports === 'object') {
58
- (module.paths || []).push('./');
59
- module.exports = exec;
60
- // This line will be removed in the next version.
61
- exec(require('date-and-time'));
62
- } else if (typeof define === 'function' && define.amd) {
63
- define(['date-and-time'], exec);
64
- } else {
65
- exec(global.date);
66
- }
63
+ return uk;
67
64
 
68
- }(this));
65
+ }));
package/locale/uz.js CHANGED
@@ -1,12 +1,16 @@
1
- /**
2
- * @preserve date-and-time.js locale configuration
3
- * @preserve Uzbek (uz)
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.uz = factory()));
5
+ })(this, (function () { 'use strict';
8
6
 
9
- var exec = function (date) {
7
+ /**
8
+ * @preserve date-and-time.js locale configuration
9
+ * @preserve Uzbek (uz)
10
+ * @preserve It is using moment.js locale configuration as a reference.
11
+ */
12
+
13
+ var uz = function (date) {
10
14
  var code = 'uz';
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 uz;
34
29
 
35
- }(this));
30
+ }));
package/locale/vi.js CHANGED
@@ -1,12 +1,16 @@
1
- /**
2
- * @preserve date-and-time.js locale configuration
3
- * @preserve Vietnamese (vi)
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.vi = factory()));
5
+ })(this, (function () { 'use strict';
8
6
 
9
- var exec = function (date) {
7
+ /**
8
+ * @preserve date-and-time.js locale configuration
9
+ * @preserve Vietnamese (vi)
10
+ * @preserve It is using moment.js locale configuration as a reference.
11
+ */
12
+
13
+ var vi = function (date) {
10
14
  var code = 'vi';
11
15
 
12
16
  date.locale(code, {
@@ -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 vi;
35
30
 
36
- }(this));
31
+ }));