@learncard/react 2.6.9 → 2.6.11

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 (207) hide show
  1. package/dist/base.css +1 -1
  2. package/dist/base.js +1 -1
  3. package/dist/cjs/{AchievementCard-52b029e8.js → AchievementCard-e5815d57.js} +4 -4
  4. package/dist/cjs/{AchievementCard-52b029e8.js.map → AchievementCard-e5815d57.js.map} +1 -1
  5. package/dist/cjs/AwardRibbon-14ba45fb.js.map +1 -1
  6. package/dist/cjs/{BoostGenericCard-7a29863b.js → BoostGenericCard-4bb2ca13.js} +8 -9
  7. package/dist/cjs/{BoostGenericCard-7a29863b.js.map → BoostGenericCard-4bb2ca13.js.map} +1 -1
  8. package/dist/cjs/{BoostSmallCard-2c5b5dfe.js → BoostSmallCard-fb2c326b.js} +8 -8
  9. package/dist/cjs/{BoostSmallCard-2c5b5dfe.js.map → BoostSmallCard-fb2c326b.js.map} +1 -1
  10. package/dist/cjs/Button-a7af702b.js.map +1 -1
  11. package/dist/cjs/Checkmark-f611aa4d.js.map +1 -1
  12. package/dist/cjs/CircleCheckButton-43c96841.js.map +1 -1
  13. package/dist/cjs/CircleIcon-a45953f5.js.map +1 -1
  14. package/dist/cjs/CircleSpinner-093cce04.js.map +1 -1
  15. package/dist/cjs/CourseCard-338a32ee.js.map +1 -1
  16. package/dist/cjs/{CourseVerticalCard-b76f5407.js → CourseVerticalCard-18166b12.js} +3 -3
  17. package/dist/cjs/{CourseVerticalCard-b76f5407.js.map → CourseVerticalCard-18166b12.js.map} +1 -1
  18. package/dist/cjs/FlippyCard-209549c5.js.map +1 -1
  19. package/dist/cjs/GenericArrow-8dfb261d.js.map +1 -1
  20. package/dist/cjs/{GenericCard-4241c598.js → GenericCard-561e9d34.js} +7 -7
  21. package/dist/cjs/{GenericCard-4241c598.js.map → GenericCard-561e9d34.js.map} +1 -1
  22. package/dist/cjs/JobHistoryCard-05a3f98b.js.map +1 -1
  23. package/dist/cjs/JobListCard-a3e030e0.js.map +1 -1
  24. package/dist/cjs/LearnCardCreditCardBackFace-87cc8b9f.js.map +1 -1
  25. package/dist/cjs/{LearnCardCreditCardFrontFace-4452fd7a.js → LearnCardCreditCardFrontFace-94be6a62.js} +2 -2
  26. package/dist/cjs/{LearnCardCreditCardFrontFace-4452fd7a.js.map → LearnCardCreditCardFrontFace-94be6a62.js.map} +1 -1
  27. package/dist/cjs/LearnPill-0b3170ea.js.map +1 -1
  28. package/dist/cjs/{Lightbox-cda1e0d5.js → Lightbox-31a90d97.js} +23 -26
  29. package/dist/cjs/{Lightbox-cda1e0d5.js.map → Lightbox-31a90d97.js.map} +1 -1
  30. package/dist/cjs/Lightbulb-1c28af02.js.map +1 -1
  31. package/dist/cjs/MiniVCThumbnail-a78e44f2.js.map +1 -1
  32. package/dist/cjs/Notification-9d230f1b.js.map +1 -1
  33. package/dist/cjs/NotificationBoostCard-3b3bd47d.js.map +1 -1
  34. package/dist/cjs/NotificationUserAcceptedBoostCard-423b9320.js.map +1 -1
  35. package/dist/cjs/NotificationUserCard-d4dab06c.js.map +1 -1
  36. package/dist/cjs/{QRCodeCard-efaa58e1.js → QRCodeCard-2a818136.js} +2 -2
  37. package/dist/cjs/{QRCodeCard-efaa58e1.js.map → QRCodeCard-2a818136.js.map} +1 -1
  38. package/dist/cjs/RoundedPill-85e7ed68.js.map +1 -1
  39. package/dist/cjs/SchoolIDCard-1baf77e8.js.map +1 -1
  40. package/dist/cjs/{SkillTabCard-14ba0618.js → SkillTabCard-c89279ab.js} +2 -2
  41. package/dist/cjs/{SkillTabCard-14ba0618.js.map → SkillTabCard-c89279ab.js.map} +1 -1
  42. package/dist/cjs/SkillVerticalCard-3eb3a8e9.js.map +1 -1
  43. package/dist/cjs/SkillsCard-4b6dbb4f.js.map +1 -1
  44. package/dist/cjs/SkillsStatsCard-97a35a88.js.map +1 -1
  45. package/dist/cjs/SmallAchievementCard-c76701ce.js.map +1 -1
  46. package/dist/cjs/Trophy-9ede7f2b.js.map +1 -1
  47. package/dist/cjs/User-92f9cf40.js.map +1 -1
  48. package/dist/cjs/{VCCard-46382b57.js → VCCard-579989b4.js} +7 -4
  49. package/dist/cjs/{VCCard-46382b57.js.map → VCCard-579989b4.js.map} +1 -1
  50. package/dist/cjs/{VCDisplayBackFace-85c80890.js → VCDisplayBackFace-7ee3d096.js} +3 -3
  51. package/dist/cjs/{VCDisplayBackFace-85c80890.js.map → VCDisplayBackFace-7ee3d096.js.map} +1 -1
  52. package/dist/cjs/{VCDisplayCard-03fc6bd1.js → VCDisplayCard-05393c28.js} +3 -3
  53. package/dist/cjs/{VCDisplayCard-03fc6bd1.js.map → VCDisplayCard-05393c28.js.map} +1 -1
  54. package/dist/cjs/{VCDisplayCard2-9b974b70.js → VCDisplayCard2-30a3240b.js} +30 -49
  55. package/dist/cjs/VCDisplayCard2-30a3240b.js.map +1 -0
  56. package/dist/cjs/VCThumbnail-6bf86bb2.js.map +1 -1
  57. package/dist/cjs/VCVerificationCheck-46fa75d3.js.map +1 -1
  58. package/dist/cjs/{VCVerificationPill-ac05903b.js → VCVerificationPill-f629fd71.js} +2 -2
  59. package/dist/cjs/{VCVerificationPill-ac05903b.js.map → VCVerificationPill-f629fd71.js.map} +1 -1
  60. package/dist/cjs/{constants-3f8ed765.js → constants-a9665278.js} +10 -10
  61. package/dist/cjs/{constants-3f8ed765.js.map → constants-a9665278.js.map} +1 -1
  62. package/dist/cjs/{credential.helpers-40149659.js → credential.helpers-a4559d6b.js} +1260 -985
  63. package/dist/cjs/credential.helpers-a4559d6b.js.map +1 -0
  64. package/dist/cjs/icons-ac6eb6ec.js.map +1 -1
  65. package/dist/cjs/{index-82de573c.js → index-8082a131.js} +21 -17
  66. package/dist/cjs/index-8082a131.js.map +1 -0
  67. package/dist/cjs/index-d057eaee.js.map +1 -1
  68. package/dist/cjs/index-d836b84d.js.map +1 -1
  69. package/dist/cjs/index.js +23 -24
  70. package/dist/cjs/index.js.map +1 -1
  71. package/dist/cjs/index11.js +1 -1
  72. package/dist/cjs/index12.js +23 -24
  73. package/dist/cjs/index12.js.map +1 -1
  74. package/dist/cjs/index16.js +2 -2
  75. package/dist/cjs/index18.js +1 -1
  76. package/dist/cjs/index2.js +15 -15
  77. package/dist/cjs/index25.js +2 -2
  78. package/dist/cjs/index27.js +1 -1
  79. package/dist/cjs/index3.js +2 -2
  80. package/dist/cjs/index31.js +3 -3
  81. package/dist/cjs/index35.js +8 -9
  82. package/dist/cjs/index35.js.map +1 -1
  83. package/dist/cjs/index36.js +4 -5
  84. package/dist/cjs/index36.js.map +1 -1
  85. package/dist/cjs/index37.js +5 -6
  86. package/dist/cjs/index37.js.map +1 -1
  87. package/dist/cjs/index38.js +5 -6
  88. package/dist/cjs/index38.js.map +1 -1
  89. package/dist/cjs/index39.js +1 -2
  90. package/dist/cjs/index39.js.map +1 -1
  91. package/dist/cjs/index4.js +5 -5
  92. package/dist/cjs/index42.js +2 -2
  93. package/dist/cjs/index9.js +6 -6
  94. package/dist/cjs/notifications-56c6fc94.js.map +1 -1
  95. package/dist/cjs/types-c83b33ec.js.map +1 -1
  96. package/dist/cjs/types-e4d9a257.js.map +1 -1
  97. package/dist/cjs/{types.esm-e38e568c.js → types.esm-8d2141ba.js} +114 -259
  98. package/dist/cjs/types.esm-8d2141ba.js.map +1 -0
  99. package/dist/esm/{AchievementCard-51b4814b.js → AchievementCard-c4121d5c.js} +4 -4
  100. package/dist/esm/{AchievementCard-51b4814b.js.map → AchievementCard-c4121d5c.js.map} +1 -1
  101. package/dist/esm/AwardRibbon-3e682281.js.map +1 -1
  102. package/dist/esm/{BoostGenericCard-ab82b8aa.js → BoostGenericCard-5aecf426.js} +3 -4
  103. package/dist/esm/{BoostGenericCard-ab82b8aa.js.map → BoostGenericCard-5aecf426.js.map} +1 -1
  104. package/dist/esm/{BoostSmallCard-2cc5a41a.js → BoostSmallCard-930b33fc.js} +3 -3
  105. package/dist/esm/{BoostSmallCard-2cc5a41a.js.map → BoostSmallCard-930b33fc.js.map} +1 -1
  106. package/dist/esm/Button-5f805204.js.map +1 -1
  107. package/dist/esm/Checkmark-d8b8f43d.js.map +1 -1
  108. package/dist/esm/CircleCheckButton-551054f6.js.map +1 -1
  109. package/dist/esm/CircleIcon-38b874e2.js.map +1 -1
  110. package/dist/esm/CircleSpinner-9b8b1a6b.js.map +1 -1
  111. package/dist/esm/CourseCard-663ff174.js.map +1 -1
  112. package/dist/esm/{CourseVerticalCard-922a0860.js → CourseVerticalCard-64c29ffb.js} +3 -3
  113. package/dist/esm/{CourseVerticalCard-922a0860.js.map → CourseVerticalCard-64c29ffb.js.map} +1 -1
  114. package/dist/esm/FlippyCard-a2de5cf1.js.map +1 -1
  115. package/dist/esm/GenericArrow-0dba1707.js.map +1 -1
  116. package/dist/esm/GenericCard-d732daa0.js +1 -1
  117. package/dist/esm/GenericCard-d732daa0.js.map +1 -1
  118. package/dist/esm/JobHistoryCard-80d4ef27.js.map +1 -1
  119. package/dist/esm/JobListCard-678e3c39.js.map +1 -1
  120. package/dist/esm/LearnCardCreditCardBackFace-9baa9e6b.js.map +1 -1
  121. package/dist/esm/{LearnCardCreditCardFrontFace-cf793917.js → LearnCardCreditCardFrontFace-f61b789c.js} +2 -2
  122. package/dist/esm/{LearnCardCreditCardFrontFace-cf793917.js.map → LearnCardCreditCardFrontFace-f61b789c.js.map} +1 -1
  123. package/dist/esm/LearnPill-8684ba99.js.map +1 -1
  124. package/dist/esm/{Lightbox-de99baca.js → Lightbox-35809729.js} +23 -26
  125. package/dist/esm/{Lightbox-de99baca.js.map → Lightbox-35809729.js.map} +1 -1
  126. package/dist/esm/Lightbulb-a3c1679f.js.map +1 -1
  127. package/dist/esm/MiniVCThumbnail-6a07e810.js.map +1 -1
  128. package/dist/esm/Notification-0f58ef6a.js.map +1 -1
  129. package/dist/esm/NotificationBoostCard-134edf94.js.map +1 -1
  130. package/dist/esm/NotificationUserAcceptedBoostCard-8c13bd3f.js.map +1 -1
  131. package/dist/esm/NotificationUserCard-dbcc80f9.js.map +1 -1
  132. package/dist/esm/{QRCodeCard-c57e2067.js → QRCodeCard-79d4d253.js} +2 -2
  133. package/dist/esm/{QRCodeCard-c57e2067.js.map → QRCodeCard-79d4d253.js.map} +1 -1
  134. package/dist/esm/RoundedPill-731211b3.js.map +1 -1
  135. package/dist/esm/SchoolIDCard-3b746226.js.map +1 -1
  136. package/dist/esm/{SkillTabCard-d86c6452.js → SkillTabCard-77074988.js} +2 -2
  137. package/dist/esm/{SkillTabCard-d86c6452.js.map → SkillTabCard-77074988.js.map} +1 -1
  138. package/dist/esm/SkillVerticalCard-108f49bb.js.map +1 -1
  139. package/dist/esm/SkillsCard-92a51db2.js.map +1 -1
  140. package/dist/esm/SkillsStatsCard-1628fe9c.js.map +1 -1
  141. package/dist/esm/SmallAchievementCard-2d87ac82.js.map +1 -1
  142. package/dist/esm/Trophy-702610b8.js.map +1 -1
  143. package/dist/esm/User-fd276ad5.js.map +1 -1
  144. package/dist/esm/{VCCard-67827b2a.js → VCCard-7cb07eaf.js} +7 -4
  145. package/dist/esm/{VCCard-67827b2a.js.map → VCCard-7cb07eaf.js.map} +1 -1
  146. package/dist/esm/{VCDisplayBackFace-4c132537.js → VCDisplayBackFace-65f7b72d.js} +3 -3
  147. package/dist/esm/{VCDisplayBackFace-4c132537.js.map → VCDisplayBackFace-65f7b72d.js.map} +1 -1
  148. package/dist/esm/{VCDisplayCard-45555392.js → VCDisplayCard-5937271f.js} +3 -3
  149. package/dist/esm/{VCDisplayCard-45555392.js.map → VCDisplayCard-5937271f.js.map} +1 -1
  150. package/dist/esm/{VCDisplayCard2-081f4ffa.js → VCDisplayCard2-80423d2b.js} +30 -49
  151. package/dist/esm/VCDisplayCard2-80423d2b.js.map +1 -0
  152. package/dist/esm/VCThumbnail-3c254bda.js.map +1 -1
  153. package/dist/esm/VCVerificationCheck-80249524.js.map +1 -1
  154. package/dist/esm/{VCVerificationPill-f4734545.js → VCVerificationPill-aa9d7bde.js} +2 -2
  155. package/dist/esm/{VCVerificationPill-f4734545.js.map → VCVerificationPill-aa9d7bde.js.map} +1 -1
  156. package/dist/esm/constants-af6897d5.js.map +1 -1
  157. package/dist/esm/{credential.helpers-3572f72c.js → credential.helpers-f57b9258.js} +1243 -968
  158. package/dist/esm/credential.helpers-f57b9258.js.map +1 -0
  159. package/dist/esm/icons-9d160530.js.map +1 -1
  160. package/dist/esm/index-7103ad3c.js.map +1 -1
  161. package/dist/esm/{index-aa1098e1.js → index-dff96076.js} +21 -17
  162. package/dist/esm/index-dff96076.js.map +1 -0
  163. package/dist/esm/index-e588d5bb.js.map +1 -1
  164. package/dist/esm/index.js +20 -21
  165. package/dist/esm/index.js.map +1 -1
  166. package/dist/esm/index12.js +20 -21
  167. package/dist/esm/index12.js.map +1 -1
  168. package/dist/esm/index16.js +2 -2
  169. package/dist/esm/index18.js +1 -1
  170. package/dist/esm/index2.js +15 -15
  171. package/dist/esm/index25.js +2 -2
  172. package/dist/esm/index3.js +2 -2
  173. package/dist/esm/index31.js +3 -3
  174. package/dist/esm/index35.js +8 -9
  175. package/dist/esm/index35.js.map +1 -1
  176. package/dist/esm/index36.js +4 -5
  177. package/dist/esm/index36.js.map +1 -1
  178. package/dist/esm/index37.js +5 -6
  179. package/dist/esm/index37.js.map +1 -1
  180. package/dist/esm/index38.js +5 -6
  181. package/dist/esm/index38.js.map +1 -1
  182. package/dist/esm/index39.js +1 -2
  183. package/dist/esm/index39.js.map +1 -1
  184. package/dist/esm/index4.js +5 -5
  185. package/dist/esm/index42.js +2 -2
  186. package/dist/esm/index9.js +6 -6
  187. package/dist/esm/notifications-009bbd80.js.map +1 -1
  188. package/dist/esm/types-7081a9e5.js.map +1 -1
  189. package/dist/esm/types-b32d28d5.js.map +1 -1
  190. package/dist/esm/{types.esm-d135a91a.js → types.esm-ee3ac019.js} +114 -259
  191. package/dist/esm/types.esm-ee3ac019.js.map +1 -0
  192. package/dist/index.d.ts +57 -57
  193. package/dist/main.css +1 -1
  194. package/dist/main.js +1 -1
  195. package/package.json +4 -4
  196. package/dist/cjs/VCDisplayCard2-9b974b70.js.map +0 -1
  197. package/dist/cjs/credential.helpers-40149659.js.map +0 -1
  198. package/dist/cjs/index-82de573c.js.map +0 -1
  199. package/dist/cjs/index-a961acab.js +0 -3538
  200. package/dist/cjs/index-a961acab.js.map +0 -1
  201. package/dist/cjs/types.esm-e38e568c.js.map +0 -1
  202. package/dist/esm/VCDisplayCard2-081f4ffa.js.map +0 -1
  203. package/dist/esm/credential.helpers-3572f72c.js.map +0 -1
  204. package/dist/esm/index-aa1098e1.js.map +0 -1
  205. package/dist/esm/index-e1f279c6.js +0 -3529
  206. package/dist/esm/index-e1f279c6.js.map +0 -1
  207. package/dist/esm/types.esm-d135a91a.js.map +0 -1
@@ -1,3538 +0,0 @@
1
- 'use strict';
2
-
3
- function toInteger(dirtyNumber) {
4
- if (dirtyNumber === null || dirtyNumber === true || dirtyNumber === false) {
5
- return NaN;
6
- }
7
-
8
- var number = Number(dirtyNumber);
9
-
10
- if (isNaN(number)) {
11
- return number;
12
- }
13
-
14
- return number < 0 ? Math.ceil(number) : Math.floor(number);
15
- }
16
-
17
- function requiredArgs(required, args) {
18
- if (args.length < required) {
19
- throw new TypeError(required + ' argument' + (required > 1 ? 's' : '') + ' required, but only ' + args.length + ' present');
20
- }
21
- }
22
-
23
- function _typeof$w(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof$w = function _typeof(obj) { return typeof obj; }; } else { _typeof$w = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof$w(obj); }
24
- /**
25
- * @name toDate
26
- * @category Common Helpers
27
- * @summary Convert the given argument to an instance of Date.
28
- *
29
- * @description
30
- * Convert the given argument to an instance of Date.
31
- *
32
- * If the argument is an instance of Date, the function returns its clone.
33
- *
34
- * If the argument is a number, it is treated as a timestamp.
35
- *
36
- * If the argument is none of the above, the function returns Invalid Date.
37
- *
38
- * **Note**: *all* Date arguments passed to any *date-fns* function is processed by `toDate`.
39
- *
40
- * @param {Date|Number} argument - the value to convert
41
- * @returns {Date} the parsed date in the local time zone
42
- * @throws {TypeError} 1 argument required
43
- *
44
- * @example
45
- * // Clone the date:
46
- * const result = toDate(new Date(2014, 1, 11, 11, 30, 30))
47
- * //=> Tue Feb 11 2014 11:30:30
48
- *
49
- * @example
50
- * // Convert the timestamp to date:
51
- * const result = toDate(1392098430000)
52
- * //=> Tue Feb 11 2014 11:30:30
53
- */
54
-
55
- function toDate(argument) {
56
- requiredArgs(1, arguments);
57
- var argStr = Object.prototype.toString.call(argument); // Clone the date
58
-
59
- if (argument instanceof Date || _typeof$w(argument) === 'object' && argStr === '[object Date]') {
60
- // Prevent the date to lose the milliseconds when passed to new Date() in IE10
61
- return new Date(argument.getTime());
62
- } else if (typeof argument === 'number' || argStr === '[object Number]') {
63
- return new Date(argument);
64
- } else {
65
- if ((typeof argument === 'string' || argStr === '[object String]') && typeof console !== 'undefined') {
66
- // eslint-disable-next-line no-console
67
- console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"); // eslint-disable-next-line no-console
68
-
69
- console.warn(new Error().stack);
70
- }
71
-
72
- return new Date(NaN);
73
- }
74
- }
75
-
76
- var defaultOptions = {};
77
- function getDefaultOptions() {
78
- return defaultOptions;
79
- }
80
-
81
- /**
82
- * Days in 1 week.
83
- *
84
- * @name daysInWeek
85
- * @constant
86
- * @type {number}
87
- * @default
88
- */
89
- /**
90
- * Milliseconds in 1 minute
91
- *
92
- * @name millisecondsInMinute
93
- * @constant
94
- * @type {number}
95
- * @default
96
- */
97
-
98
- var millisecondsInMinute = 60000;
99
- /**
100
- * Milliseconds in 1 hour
101
- *
102
- * @name millisecondsInHour
103
- * @constant
104
- * @type {number}
105
- * @default
106
- */
107
-
108
- var millisecondsInHour = 3600000;
109
- /**
110
- * Milliseconds in 1 second
111
- *
112
- * @name millisecondsInSecond
113
- * @constant
114
- * @type {number}
115
- * @default
116
- */
117
-
118
- var millisecondsInSecond = 1000;
119
-
120
- function startOfUTCISOWeek(dirtyDate) {
121
- requiredArgs(1, arguments);
122
- var weekStartsOn = 1;
123
- var date = toDate(dirtyDate);
124
- var day = date.getUTCDay();
125
- var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;
126
- date.setUTCDate(date.getUTCDate() - diff);
127
- date.setUTCHours(0, 0, 0, 0);
128
- return date;
129
- }
130
-
131
- function getUTCISOWeekYear(dirtyDate) {
132
- requiredArgs(1, arguments);
133
- var date = toDate(dirtyDate);
134
- var year = date.getUTCFullYear();
135
- var fourthOfJanuaryOfNextYear = new Date(0);
136
- fourthOfJanuaryOfNextYear.setUTCFullYear(year + 1, 0, 4);
137
- fourthOfJanuaryOfNextYear.setUTCHours(0, 0, 0, 0);
138
- var startOfNextYear = startOfUTCISOWeek(fourthOfJanuaryOfNextYear);
139
- var fourthOfJanuaryOfThisYear = new Date(0);
140
- fourthOfJanuaryOfThisYear.setUTCFullYear(year, 0, 4);
141
- fourthOfJanuaryOfThisYear.setUTCHours(0, 0, 0, 0);
142
- var startOfThisYear = startOfUTCISOWeek(fourthOfJanuaryOfThisYear);
143
-
144
- if (date.getTime() >= startOfNextYear.getTime()) {
145
- return year + 1;
146
- } else if (date.getTime() >= startOfThisYear.getTime()) {
147
- return year;
148
- } else {
149
- return year - 1;
150
- }
151
- }
152
-
153
- function startOfUTCISOWeekYear(dirtyDate) {
154
- requiredArgs(1, arguments);
155
- var year = getUTCISOWeekYear(dirtyDate);
156
- var fourthOfJanuary = new Date(0);
157
- fourthOfJanuary.setUTCFullYear(year, 0, 4);
158
- fourthOfJanuary.setUTCHours(0, 0, 0, 0);
159
- var date = startOfUTCISOWeek(fourthOfJanuary);
160
- return date;
161
- }
162
-
163
- var MILLISECONDS_IN_WEEK$1 = 604800000;
164
- function getUTCISOWeek(dirtyDate) {
165
- requiredArgs(1, arguments);
166
- var date = toDate(dirtyDate);
167
- var diff = startOfUTCISOWeek(date).getTime() - startOfUTCISOWeekYear(date).getTime(); // Round the number of days to the nearest integer
168
- // because the number of milliseconds in a week is not constant
169
- // (e.g. it's different in the week of the daylight saving time clock shift)
170
-
171
- return Math.round(diff / MILLISECONDS_IN_WEEK$1) + 1;
172
- }
173
-
174
- function startOfUTCWeek(dirtyDate, options) {
175
- var _ref, _ref2, _ref3, _options$weekStartsOn, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2;
176
-
177
- requiredArgs(1, arguments);
178
- var defaultOptions = getDefaultOptions();
179
- var weekStartsOn = toInteger((_ref = (_ref2 = (_ref3 = (_options$weekStartsOn = options === null || options === void 0 ? void 0 : options.weekStartsOn) !== null && _options$weekStartsOn !== void 0 ? _options$weekStartsOn : options === null || options === void 0 ? void 0 : (_options$locale = options.locale) === null || _options$locale === void 0 ? void 0 : (_options$locale$optio = _options$locale.options) === null || _options$locale$optio === void 0 ? void 0 : _options$locale$optio.weekStartsOn) !== null && _ref3 !== void 0 ? _ref3 : defaultOptions.weekStartsOn) !== null && _ref2 !== void 0 ? _ref2 : (_defaultOptions$local = defaultOptions.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.weekStartsOn) !== null && _ref !== void 0 ? _ref : 0); // Test if weekStartsOn is between 0 and 6 _and_ is not NaN
180
-
181
- if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {
182
- throw new RangeError('weekStartsOn must be between 0 and 6 inclusively');
183
- }
184
-
185
- var date = toDate(dirtyDate);
186
- var day = date.getUTCDay();
187
- var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;
188
- date.setUTCDate(date.getUTCDate() - diff);
189
- date.setUTCHours(0, 0, 0, 0);
190
- return date;
191
- }
192
-
193
- function getUTCWeekYear(dirtyDate, options) {
194
- var _ref, _ref2, _ref3, _options$firstWeekCon, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2;
195
-
196
- requiredArgs(1, arguments);
197
- var date = toDate(dirtyDate);
198
- var year = date.getUTCFullYear();
199
- var defaultOptions = getDefaultOptions();
200
- var firstWeekContainsDate = toInteger((_ref = (_ref2 = (_ref3 = (_options$firstWeekCon = options === null || options === void 0 ? void 0 : options.firstWeekContainsDate) !== null && _options$firstWeekCon !== void 0 ? _options$firstWeekCon : options === null || options === void 0 ? void 0 : (_options$locale = options.locale) === null || _options$locale === void 0 ? void 0 : (_options$locale$optio = _options$locale.options) === null || _options$locale$optio === void 0 ? void 0 : _options$locale$optio.firstWeekContainsDate) !== null && _ref3 !== void 0 ? _ref3 : defaultOptions.firstWeekContainsDate) !== null && _ref2 !== void 0 ? _ref2 : (_defaultOptions$local = defaultOptions.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.firstWeekContainsDate) !== null && _ref !== void 0 ? _ref : 1); // Test if weekStartsOn is between 1 and 7 _and_ is not NaN
201
-
202
- if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) {
203
- throw new RangeError('firstWeekContainsDate must be between 1 and 7 inclusively');
204
- }
205
-
206
- var firstWeekOfNextYear = new Date(0);
207
- firstWeekOfNextYear.setUTCFullYear(year + 1, 0, firstWeekContainsDate);
208
- firstWeekOfNextYear.setUTCHours(0, 0, 0, 0);
209
- var startOfNextYear = startOfUTCWeek(firstWeekOfNextYear, options);
210
- var firstWeekOfThisYear = new Date(0);
211
- firstWeekOfThisYear.setUTCFullYear(year, 0, firstWeekContainsDate);
212
- firstWeekOfThisYear.setUTCHours(0, 0, 0, 0);
213
- var startOfThisYear = startOfUTCWeek(firstWeekOfThisYear, options);
214
-
215
- if (date.getTime() >= startOfNextYear.getTime()) {
216
- return year + 1;
217
- } else if (date.getTime() >= startOfThisYear.getTime()) {
218
- return year;
219
- } else {
220
- return year - 1;
221
- }
222
- }
223
-
224
- function startOfUTCWeekYear(dirtyDate, options) {
225
- var _ref, _ref2, _ref3, _options$firstWeekCon, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2;
226
-
227
- requiredArgs(1, arguments);
228
- var defaultOptions = getDefaultOptions();
229
- var firstWeekContainsDate = toInteger((_ref = (_ref2 = (_ref3 = (_options$firstWeekCon = options === null || options === void 0 ? void 0 : options.firstWeekContainsDate) !== null && _options$firstWeekCon !== void 0 ? _options$firstWeekCon : options === null || options === void 0 ? void 0 : (_options$locale = options.locale) === null || _options$locale === void 0 ? void 0 : (_options$locale$optio = _options$locale.options) === null || _options$locale$optio === void 0 ? void 0 : _options$locale$optio.firstWeekContainsDate) !== null && _ref3 !== void 0 ? _ref3 : defaultOptions.firstWeekContainsDate) !== null && _ref2 !== void 0 ? _ref2 : (_defaultOptions$local = defaultOptions.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.firstWeekContainsDate) !== null && _ref !== void 0 ? _ref : 1);
230
- var year = getUTCWeekYear(dirtyDate, options);
231
- var firstWeek = new Date(0);
232
- firstWeek.setUTCFullYear(year, 0, firstWeekContainsDate);
233
- firstWeek.setUTCHours(0, 0, 0, 0);
234
- var date = startOfUTCWeek(firstWeek, options);
235
- return date;
236
- }
237
-
238
- var MILLISECONDS_IN_WEEK = 604800000;
239
- function getUTCWeek(dirtyDate, options) {
240
- requiredArgs(1, arguments);
241
- var date = toDate(dirtyDate);
242
- var diff = startOfUTCWeek(date, options).getTime() - startOfUTCWeekYear(date, options).getTime(); // Round the number of days to the nearest integer
243
- // because the number of milliseconds in a week is not constant
244
- // (e.g. it's different in the week of the daylight saving time clock shift)
245
-
246
- return Math.round(diff / MILLISECONDS_IN_WEEK) + 1;
247
- }
248
-
249
- function _typeof$v(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof$v = function _typeof(obj) { return typeof obj; }; } else { _typeof$v = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof$v(obj); }
250
-
251
- function _inherits$v(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf$v(subClass, superClass); }
252
-
253
- function _setPrototypeOf$v(o, p) { _setPrototypeOf$v = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf$v(o, p); }
254
-
255
- function _createSuper$v(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$v(); return function _createSuperInternal() { var Super = _getPrototypeOf$v(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf$v(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn$v(this, result); }; }
256
-
257
- function _possibleConstructorReturn$v(self, call) { if (call && (_typeof$v(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized$v(self); }
258
-
259
- function _assertThisInitialized$v(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
260
-
261
- function _isNativeReflectConstruct$v() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
262
-
263
- function _getPrototypeOf$v(o) { _getPrototypeOf$v = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf$v(o); }
264
-
265
- function _classCallCheck$w(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
266
-
267
- function _defineProperties$w(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
268
-
269
- function _createClass$w(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties$w(Constructor.prototype, protoProps); if (staticProps) _defineProperties$w(Constructor, staticProps); return Constructor; }
270
-
271
- function _defineProperty$v(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
272
- var Setter = /*#__PURE__*/function () {
273
- function Setter() {
274
- _classCallCheck$w(this, Setter);
275
-
276
- _defineProperty$v(this, "subPriority", 0);
277
- }
278
-
279
- _createClass$w(Setter, [{
280
- key: "validate",
281
- value: function validate(_utcDate, _options) {
282
- return true;
283
- }
284
- }]);
285
-
286
- return Setter;
287
- }();
288
- var ValueSetter = /*#__PURE__*/function (_Setter) {
289
- _inherits$v(ValueSetter, _Setter);
290
-
291
- var _super = _createSuper$v(ValueSetter);
292
-
293
- function ValueSetter(value, validateValue, setValue, priority, subPriority) {
294
- var _this;
295
-
296
- _classCallCheck$w(this, ValueSetter);
297
-
298
- _this = _super.call(this);
299
- _this.value = value;
300
- _this.validateValue = validateValue;
301
- _this.setValue = setValue;
302
- _this.priority = priority;
303
-
304
- if (subPriority) {
305
- _this.subPriority = subPriority;
306
- }
307
-
308
- return _this;
309
- }
310
-
311
- _createClass$w(ValueSetter, [{
312
- key: "validate",
313
- value: function validate(utcDate, options) {
314
- return this.validateValue(utcDate, this.value, options);
315
- }
316
- }, {
317
- key: "set",
318
- value: function set(utcDate, flags, options) {
319
- return this.setValue(utcDate, flags, this.value, options);
320
- }
321
- }]);
322
-
323
- return ValueSetter;
324
- }(Setter);
325
-
326
- function _classCallCheck$v(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
327
-
328
- function _defineProperties$v(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
329
-
330
- function _createClass$v(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties$v(Constructor.prototype, protoProps); if (staticProps) _defineProperties$v(Constructor, staticProps); return Constructor; }
331
- var Parser = /*#__PURE__*/function () {
332
- function Parser() {
333
- _classCallCheck$v(this, Parser);
334
- }
335
-
336
- _createClass$v(Parser, [{
337
- key: "run",
338
- value: function run(dateString, token, match, options) {
339
- var result = this.parse(dateString, token, match, options);
340
-
341
- if (!result) {
342
- return null;
343
- }
344
-
345
- return {
346
- setter: new ValueSetter(result.value, this.validate, this.set, this.priority, this.subPriority),
347
- rest: result.rest
348
- };
349
- }
350
- }, {
351
- key: "validate",
352
- value: function validate(_utcDate, _value, _options) {
353
- return true;
354
- }
355
- }]);
356
-
357
- return Parser;
358
- }();
359
-
360
- function _typeof$u(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof$u = function _typeof(obj) { return typeof obj; }; } else { _typeof$u = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof$u(obj); }
361
-
362
- function _classCallCheck$u(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
363
-
364
- function _defineProperties$u(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
365
-
366
- function _createClass$u(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties$u(Constructor.prototype, protoProps); if (staticProps) _defineProperties$u(Constructor, staticProps); return Constructor; }
367
-
368
- function _inherits$u(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf$u(subClass, superClass); }
369
-
370
- function _setPrototypeOf$u(o, p) { _setPrototypeOf$u = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf$u(o, p); }
371
-
372
- function _createSuper$u(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$u(); return function _createSuperInternal() { var Super = _getPrototypeOf$u(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf$u(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn$u(this, result); }; }
373
-
374
- function _possibleConstructorReturn$u(self, call) { if (call && (_typeof$u(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized$u(self); }
375
-
376
- function _assertThisInitialized$u(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
377
-
378
- function _isNativeReflectConstruct$u() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
379
-
380
- function _getPrototypeOf$u(o) { _getPrototypeOf$u = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf$u(o); }
381
-
382
- function _defineProperty$u(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
383
- var EraParser = /*#__PURE__*/function (_Parser) {
384
- _inherits$u(EraParser, _Parser);
385
-
386
- var _super = _createSuper$u(EraParser);
387
-
388
- function EraParser() {
389
- var _this;
390
-
391
- _classCallCheck$u(this, EraParser);
392
-
393
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
394
- args[_key] = arguments[_key];
395
- }
396
-
397
- _this = _super.call.apply(_super, [this].concat(args));
398
-
399
- _defineProperty$u(_assertThisInitialized$u(_this), "priority", 140);
400
-
401
- _defineProperty$u(_assertThisInitialized$u(_this), "incompatibleTokens", ['R', 'u', 't', 'T']);
402
-
403
- return _this;
404
- }
405
-
406
- _createClass$u(EraParser, [{
407
- key: "parse",
408
- value: function parse(dateString, token, match) {
409
- switch (token) {
410
- // AD, BC
411
- case 'G':
412
- case 'GG':
413
- case 'GGG':
414
- return match.era(dateString, {
415
- width: 'abbreviated'
416
- }) || match.era(dateString, {
417
- width: 'narrow'
418
- });
419
- // A, B
420
-
421
- case 'GGGGG':
422
- return match.era(dateString, {
423
- width: 'narrow'
424
- });
425
- // Anno Domini, Before Christ
426
-
427
- case 'GGGG':
428
- default:
429
- return match.era(dateString, {
430
- width: 'wide'
431
- }) || match.era(dateString, {
432
- width: 'abbreviated'
433
- }) || match.era(dateString, {
434
- width: 'narrow'
435
- });
436
- }
437
- }
438
- }, {
439
- key: "set",
440
- value: function set(date, flags, value) {
441
- flags.era = value;
442
- date.setUTCFullYear(value, 0, 1);
443
- date.setUTCHours(0, 0, 0, 0);
444
- return date;
445
- }
446
- }]);
447
-
448
- return EraParser;
449
- }(Parser);
450
-
451
- var numericPatterns = {
452
- month: /^(1[0-2]|0?\d)/,
453
- // 0 to 12
454
- date: /^(3[0-1]|[0-2]?\d)/,
455
- // 0 to 31
456
- dayOfYear: /^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,
457
- // 0 to 366
458
- week: /^(5[0-3]|[0-4]?\d)/,
459
- // 0 to 53
460
- hour23h: /^(2[0-3]|[0-1]?\d)/,
461
- // 0 to 23
462
- hour24h: /^(2[0-4]|[0-1]?\d)/,
463
- // 0 to 24
464
- hour11h: /^(1[0-1]|0?\d)/,
465
- // 0 to 11
466
- hour12h: /^(1[0-2]|0?\d)/,
467
- // 0 to 12
468
- minute: /^[0-5]?\d/,
469
- // 0 to 59
470
- second: /^[0-5]?\d/,
471
- // 0 to 59
472
- singleDigit: /^\d/,
473
- // 0 to 9
474
- twoDigits: /^\d{1,2}/,
475
- // 0 to 99
476
- threeDigits: /^\d{1,3}/,
477
- // 0 to 999
478
- fourDigits: /^\d{1,4}/,
479
- // 0 to 9999
480
- anyDigitsSigned: /^-?\d+/,
481
- singleDigitSigned: /^-?\d/,
482
- // 0 to 9, -0 to -9
483
- twoDigitsSigned: /^-?\d{1,2}/,
484
- // 0 to 99, -0 to -99
485
- threeDigitsSigned: /^-?\d{1,3}/,
486
- // 0 to 999, -0 to -999
487
- fourDigitsSigned: /^-?\d{1,4}/ // 0 to 9999, -0 to -9999
488
-
489
- };
490
- var timezonePatterns = {
491
- basicOptionalMinutes: /^([+-])(\d{2})(\d{2})?|Z/,
492
- basic: /^([+-])(\d{2})(\d{2})|Z/,
493
- basicOptionalSeconds: /^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,
494
- extended: /^([+-])(\d{2}):(\d{2})|Z/,
495
- extendedOptionalSeconds: /^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/
496
- };
497
-
498
- function mapValue(parseFnResult, mapFn) {
499
- if (!parseFnResult) {
500
- return parseFnResult;
501
- }
502
-
503
- return {
504
- value: mapFn(parseFnResult.value),
505
- rest: parseFnResult.rest
506
- };
507
- }
508
- function parseNumericPattern(pattern, dateString) {
509
- var matchResult = dateString.match(pattern);
510
-
511
- if (!matchResult) {
512
- return null;
513
- }
514
-
515
- return {
516
- value: parseInt(matchResult[0], 10),
517
- rest: dateString.slice(matchResult[0].length)
518
- };
519
- }
520
- function parseTimezonePattern(pattern, dateString) {
521
- var matchResult = dateString.match(pattern);
522
-
523
- if (!matchResult) {
524
- return null;
525
- } // Input is 'Z'
526
-
527
-
528
- if (matchResult[0] === 'Z') {
529
- return {
530
- value: 0,
531
- rest: dateString.slice(1)
532
- };
533
- }
534
-
535
- var sign = matchResult[1] === '+' ? 1 : -1;
536
- var hours = matchResult[2] ? parseInt(matchResult[2], 10) : 0;
537
- var minutes = matchResult[3] ? parseInt(matchResult[3], 10) : 0;
538
- var seconds = matchResult[5] ? parseInt(matchResult[5], 10) : 0;
539
- return {
540
- value: sign * (hours * millisecondsInHour + minutes * millisecondsInMinute + seconds * millisecondsInSecond),
541
- rest: dateString.slice(matchResult[0].length)
542
- };
543
- }
544
- function parseAnyDigitsSigned(dateString) {
545
- return parseNumericPattern(numericPatterns.anyDigitsSigned, dateString);
546
- }
547
- function parseNDigits(n, dateString) {
548
- switch (n) {
549
- case 1:
550
- return parseNumericPattern(numericPatterns.singleDigit, dateString);
551
-
552
- case 2:
553
- return parseNumericPattern(numericPatterns.twoDigits, dateString);
554
-
555
- case 3:
556
- return parseNumericPattern(numericPatterns.threeDigits, dateString);
557
-
558
- case 4:
559
- return parseNumericPattern(numericPatterns.fourDigits, dateString);
560
-
561
- default:
562
- return parseNumericPattern(new RegExp('^\\d{1,' + n + '}'), dateString);
563
- }
564
- }
565
- function parseNDigitsSigned(n, dateString) {
566
- switch (n) {
567
- case 1:
568
- return parseNumericPattern(numericPatterns.singleDigitSigned, dateString);
569
-
570
- case 2:
571
- return parseNumericPattern(numericPatterns.twoDigitsSigned, dateString);
572
-
573
- case 3:
574
- return parseNumericPattern(numericPatterns.threeDigitsSigned, dateString);
575
-
576
- case 4:
577
- return parseNumericPattern(numericPatterns.fourDigitsSigned, dateString);
578
-
579
- default:
580
- return parseNumericPattern(new RegExp('^-?\\d{1,' + n + '}'), dateString);
581
- }
582
- }
583
- function dayPeriodEnumToHours(dayPeriod) {
584
- switch (dayPeriod) {
585
- case 'morning':
586
- return 4;
587
-
588
- case 'evening':
589
- return 17;
590
-
591
- case 'pm':
592
- case 'noon':
593
- case 'afternoon':
594
- return 12;
595
-
596
- case 'am':
597
- case 'midnight':
598
- case 'night':
599
- default:
600
- return 0;
601
- }
602
- }
603
- function normalizeTwoDigitYear(twoDigitYear, currentYear) {
604
- var isCommonEra = currentYear > 0; // Absolute number of the current year:
605
- // 1 -> 1 AC
606
- // 0 -> 1 BC
607
- // -1 -> 2 BC
608
-
609
- var absCurrentYear = isCommonEra ? currentYear : 1 - currentYear;
610
- var result;
611
-
612
- if (absCurrentYear <= 50) {
613
- result = twoDigitYear || 100;
614
- } else {
615
- var rangeEnd = absCurrentYear + 50;
616
- var rangeEndCentury = Math.floor(rangeEnd / 100) * 100;
617
- var isPreviousCentury = twoDigitYear >= rangeEnd % 100;
618
- result = twoDigitYear + rangeEndCentury - (isPreviousCentury ? 100 : 0);
619
- }
620
-
621
- return isCommonEra ? result : 1 - result;
622
- }
623
- function isLeapYearIndex(year) {
624
- return year % 400 === 0 || year % 4 === 0 && year % 100 !== 0;
625
- }
626
-
627
- function _typeof$t(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof$t = function _typeof(obj) { return typeof obj; }; } else { _typeof$t = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof$t(obj); }
628
-
629
- function _classCallCheck$t(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
630
-
631
- function _defineProperties$t(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
632
-
633
- function _createClass$t(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties$t(Constructor.prototype, protoProps); if (staticProps) _defineProperties$t(Constructor, staticProps); return Constructor; }
634
-
635
- function _inherits$t(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf$t(subClass, superClass); }
636
-
637
- function _setPrototypeOf$t(o, p) { _setPrototypeOf$t = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf$t(o, p); }
638
-
639
- function _createSuper$t(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$t(); return function _createSuperInternal() { var Super = _getPrototypeOf$t(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf$t(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn$t(this, result); }; }
640
-
641
- function _possibleConstructorReturn$t(self, call) { if (call && (_typeof$t(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized$t(self); }
642
-
643
- function _assertThisInitialized$t(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
644
-
645
- function _isNativeReflectConstruct$t() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
646
-
647
- function _getPrototypeOf$t(o) { _getPrototypeOf$t = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf$t(o); }
648
-
649
- function _defineProperty$t(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
650
- // From http://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Format_Patterns
651
- // | Year | y | yy | yyy | yyyy | yyyyy |
652
- // |----------|-------|----|-------|-------|-------|
653
- // | AD 1 | 1 | 01 | 001 | 0001 | 00001 |
654
- // | AD 12 | 12 | 12 | 012 | 0012 | 00012 |
655
- // | AD 123 | 123 | 23 | 123 | 0123 | 00123 |
656
- // | AD 1234 | 1234 | 34 | 1234 | 1234 | 01234 |
657
- // | AD 12345 | 12345 | 45 | 12345 | 12345 | 12345 |
658
- var YearParser = /*#__PURE__*/function (_Parser) {
659
- _inherits$t(YearParser, _Parser);
660
-
661
- var _super = _createSuper$t(YearParser);
662
-
663
- function YearParser() {
664
- var _this;
665
-
666
- _classCallCheck$t(this, YearParser);
667
-
668
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
669
- args[_key] = arguments[_key];
670
- }
671
-
672
- _this = _super.call.apply(_super, [this].concat(args));
673
-
674
- _defineProperty$t(_assertThisInitialized$t(_this), "priority", 130);
675
-
676
- _defineProperty$t(_assertThisInitialized$t(_this), "incompatibleTokens", ['Y', 'R', 'u', 'w', 'I', 'i', 'e', 'c', 't', 'T']);
677
-
678
- return _this;
679
- }
680
-
681
- _createClass$t(YearParser, [{
682
- key: "parse",
683
- value: function parse(dateString, token, match) {
684
- var valueCallback = function valueCallback(year) {
685
- return {
686
- year: year,
687
- isTwoDigitYear: token === 'yy'
688
- };
689
- };
690
-
691
- switch (token) {
692
- case 'y':
693
- return mapValue(parseNDigits(4, dateString), valueCallback);
694
-
695
- case 'yo':
696
- return mapValue(match.ordinalNumber(dateString, {
697
- unit: 'year'
698
- }), valueCallback);
699
-
700
- default:
701
- return mapValue(parseNDigits(token.length, dateString), valueCallback);
702
- }
703
- }
704
- }, {
705
- key: "validate",
706
- value: function validate(_date, value) {
707
- return value.isTwoDigitYear || value.year > 0;
708
- }
709
- }, {
710
- key: "set",
711
- value: function set(date, flags, value) {
712
- var currentYear = date.getUTCFullYear();
713
-
714
- if (value.isTwoDigitYear) {
715
- var normalizedTwoDigitYear = normalizeTwoDigitYear(value.year, currentYear);
716
- date.setUTCFullYear(normalizedTwoDigitYear, 0, 1);
717
- date.setUTCHours(0, 0, 0, 0);
718
- return date;
719
- }
720
-
721
- var year = !('era' in flags) || flags.era === 1 ? value.year : 1 - value.year;
722
- date.setUTCFullYear(year, 0, 1);
723
- date.setUTCHours(0, 0, 0, 0);
724
- return date;
725
- }
726
- }]);
727
-
728
- return YearParser;
729
- }(Parser);
730
-
731
- function _typeof$s(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof$s = function _typeof(obj) { return typeof obj; }; } else { _typeof$s = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof$s(obj); }
732
-
733
- function _classCallCheck$s(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
734
-
735
- function _defineProperties$s(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
736
-
737
- function _createClass$s(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties$s(Constructor.prototype, protoProps); if (staticProps) _defineProperties$s(Constructor, staticProps); return Constructor; }
738
-
739
- function _inherits$s(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf$s(subClass, superClass); }
740
-
741
- function _setPrototypeOf$s(o, p) { _setPrototypeOf$s = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf$s(o, p); }
742
-
743
- function _createSuper$s(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$s(); return function _createSuperInternal() { var Super = _getPrototypeOf$s(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf$s(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn$s(this, result); }; }
744
-
745
- function _possibleConstructorReturn$s(self, call) { if (call && (_typeof$s(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized$s(self); }
746
-
747
- function _assertThisInitialized$s(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
748
-
749
- function _isNativeReflectConstruct$s() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
750
-
751
- function _getPrototypeOf$s(o) { _getPrototypeOf$s = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf$s(o); }
752
-
753
- function _defineProperty$s(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
754
- // Local week-numbering year
755
- var LocalWeekYearParser = /*#__PURE__*/function (_Parser) {
756
- _inherits$s(LocalWeekYearParser, _Parser);
757
-
758
- var _super = _createSuper$s(LocalWeekYearParser);
759
-
760
- function LocalWeekYearParser() {
761
- var _this;
762
-
763
- _classCallCheck$s(this, LocalWeekYearParser);
764
-
765
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
766
- args[_key] = arguments[_key];
767
- }
768
-
769
- _this = _super.call.apply(_super, [this].concat(args));
770
-
771
- _defineProperty$s(_assertThisInitialized$s(_this), "priority", 130);
772
-
773
- _defineProperty$s(_assertThisInitialized$s(_this), "incompatibleTokens", ['y', 'R', 'u', 'Q', 'q', 'M', 'L', 'I', 'd', 'D', 'i', 't', 'T']);
774
-
775
- return _this;
776
- }
777
-
778
- _createClass$s(LocalWeekYearParser, [{
779
- key: "parse",
780
- value: function parse(dateString, token, match) {
781
- var valueCallback = function valueCallback(year) {
782
- return {
783
- year: year,
784
- isTwoDigitYear: token === 'YY'
785
- };
786
- };
787
-
788
- switch (token) {
789
- case 'Y':
790
- return mapValue(parseNDigits(4, dateString), valueCallback);
791
-
792
- case 'Yo':
793
- return mapValue(match.ordinalNumber(dateString, {
794
- unit: 'year'
795
- }), valueCallback);
796
-
797
- default:
798
- return mapValue(parseNDigits(token.length, dateString), valueCallback);
799
- }
800
- }
801
- }, {
802
- key: "validate",
803
- value: function validate(_date, value) {
804
- return value.isTwoDigitYear || value.year > 0;
805
- }
806
- }, {
807
- key: "set",
808
- value: function set(date, flags, value, options) {
809
- var currentYear = getUTCWeekYear(date, options);
810
-
811
- if (value.isTwoDigitYear) {
812
- var normalizedTwoDigitYear = normalizeTwoDigitYear(value.year, currentYear);
813
- date.setUTCFullYear(normalizedTwoDigitYear, 0, options.firstWeekContainsDate);
814
- date.setUTCHours(0, 0, 0, 0);
815
- return startOfUTCWeek(date, options);
816
- }
817
-
818
- var year = !('era' in flags) || flags.era === 1 ? value.year : 1 - value.year;
819
- date.setUTCFullYear(year, 0, options.firstWeekContainsDate);
820
- date.setUTCHours(0, 0, 0, 0);
821
- return startOfUTCWeek(date, options);
822
- }
823
- }]);
824
-
825
- return LocalWeekYearParser;
826
- }(Parser);
827
-
828
- function _typeof$r(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof$r = function _typeof(obj) { return typeof obj; }; } else { _typeof$r = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof$r(obj); }
829
-
830
- function _classCallCheck$r(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
831
-
832
- function _defineProperties$r(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
833
-
834
- function _createClass$r(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties$r(Constructor.prototype, protoProps); if (staticProps) _defineProperties$r(Constructor, staticProps); return Constructor; }
835
-
836
- function _inherits$r(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf$r(subClass, superClass); }
837
-
838
- function _setPrototypeOf$r(o, p) { _setPrototypeOf$r = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf$r(o, p); }
839
-
840
- function _createSuper$r(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$r(); return function _createSuperInternal() { var Super = _getPrototypeOf$r(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf$r(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn$r(this, result); }; }
841
-
842
- function _possibleConstructorReturn$r(self, call) { if (call && (_typeof$r(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized$r(self); }
843
-
844
- function _assertThisInitialized$r(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
845
-
846
- function _isNativeReflectConstruct$r() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
847
-
848
- function _getPrototypeOf$r(o) { _getPrototypeOf$r = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf$r(o); }
849
-
850
- function _defineProperty$r(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
851
-
852
- var ISOWeekYearParser = /*#__PURE__*/function (_Parser) {
853
- _inherits$r(ISOWeekYearParser, _Parser);
854
-
855
- var _super = _createSuper$r(ISOWeekYearParser);
856
-
857
- function ISOWeekYearParser() {
858
- var _this;
859
-
860
- _classCallCheck$r(this, ISOWeekYearParser);
861
-
862
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
863
- args[_key] = arguments[_key];
864
- }
865
-
866
- _this = _super.call.apply(_super, [this].concat(args));
867
-
868
- _defineProperty$r(_assertThisInitialized$r(_this), "priority", 130);
869
-
870
- _defineProperty$r(_assertThisInitialized$r(_this), "incompatibleTokens", ['G', 'y', 'Y', 'u', 'Q', 'q', 'M', 'L', 'w', 'd', 'D', 'e', 'c', 't', 'T']);
871
-
872
- return _this;
873
- }
874
-
875
- _createClass$r(ISOWeekYearParser, [{
876
- key: "parse",
877
- value: function parse(dateString, token) {
878
- if (token === 'R') {
879
- return parseNDigitsSigned(4, dateString);
880
- }
881
-
882
- return parseNDigitsSigned(token.length, dateString);
883
- }
884
- }, {
885
- key: "set",
886
- value: function set(_date, _flags, value) {
887
- var firstWeekOfYear = new Date(0);
888
- firstWeekOfYear.setUTCFullYear(value, 0, 4);
889
- firstWeekOfYear.setUTCHours(0, 0, 0, 0);
890
- return startOfUTCISOWeek(firstWeekOfYear);
891
- }
892
- }]);
893
-
894
- return ISOWeekYearParser;
895
- }(Parser);
896
-
897
- function _typeof$q(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof$q = function _typeof(obj) { return typeof obj; }; } else { _typeof$q = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof$q(obj); }
898
-
899
- function _classCallCheck$q(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
900
-
901
- function _defineProperties$q(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
902
-
903
- function _createClass$q(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties$q(Constructor.prototype, protoProps); if (staticProps) _defineProperties$q(Constructor, staticProps); return Constructor; }
904
-
905
- function _inherits$q(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf$q(subClass, superClass); }
906
-
907
- function _setPrototypeOf$q(o, p) { _setPrototypeOf$q = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf$q(o, p); }
908
-
909
- function _createSuper$q(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$q(); return function _createSuperInternal() { var Super = _getPrototypeOf$q(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf$q(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn$q(this, result); }; }
910
-
911
- function _possibleConstructorReturn$q(self, call) { if (call && (_typeof$q(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized$q(self); }
912
-
913
- function _assertThisInitialized$q(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
914
-
915
- function _isNativeReflectConstruct$q() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
916
-
917
- function _getPrototypeOf$q(o) { _getPrototypeOf$q = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf$q(o); }
918
-
919
- function _defineProperty$q(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
920
- var ExtendedYearParser = /*#__PURE__*/function (_Parser) {
921
- _inherits$q(ExtendedYearParser, _Parser);
922
-
923
- var _super = _createSuper$q(ExtendedYearParser);
924
-
925
- function ExtendedYearParser() {
926
- var _this;
927
-
928
- _classCallCheck$q(this, ExtendedYearParser);
929
-
930
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
931
- args[_key] = arguments[_key];
932
- }
933
-
934
- _this = _super.call.apply(_super, [this].concat(args));
935
-
936
- _defineProperty$q(_assertThisInitialized$q(_this), "priority", 130);
937
-
938
- _defineProperty$q(_assertThisInitialized$q(_this), "incompatibleTokens", ['G', 'y', 'Y', 'R', 'w', 'I', 'i', 'e', 'c', 't', 'T']);
939
-
940
- return _this;
941
- }
942
-
943
- _createClass$q(ExtendedYearParser, [{
944
- key: "parse",
945
- value: function parse(dateString, token) {
946
- if (token === 'u') {
947
- return parseNDigitsSigned(4, dateString);
948
- }
949
-
950
- return parseNDigitsSigned(token.length, dateString);
951
- }
952
- }, {
953
- key: "set",
954
- value: function set(date, _flags, value) {
955
- date.setUTCFullYear(value, 0, 1);
956
- date.setUTCHours(0, 0, 0, 0);
957
- return date;
958
- }
959
- }]);
960
-
961
- return ExtendedYearParser;
962
- }(Parser);
963
-
964
- function _typeof$p(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof$p = function _typeof(obj) { return typeof obj; }; } else { _typeof$p = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof$p(obj); }
965
-
966
- function _classCallCheck$p(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
967
-
968
- function _defineProperties$p(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
969
-
970
- function _createClass$p(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties$p(Constructor.prototype, protoProps); if (staticProps) _defineProperties$p(Constructor, staticProps); return Constructor; }
971
-
972
- function _inherits$p(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf$p(subClass, superClass); }
973
-
974
- function _setPrototypeOf$p(o, p) { _setPrototypeOf$p = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf$p(o, p); }
975
-
976
- function _createSuper$p(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$p(); return function _createSuperInternal() { var Super = _getPrototypeOf$p(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf$p(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn$p(this, result); }; }
977
-
978
- function _possibleConstructorReturn$p(self, call) { if (call && (_typeof$p(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized$p(self); }
979
-
980
- function _assertThisInitialized$p(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
981
-
982
- function _isNativeReflectConstruct$p() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
983
-
984
- function _getPrototypeOf$p(o) { _getPrototypeOf$p = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf$p(o); }
985
-
986
- function _defineProperty$p(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
987
- var QuarterParser = /*#__PURE__*/function (_Parser) {
988
- _inherits$p(QuarterParser, _Parser);
989
-
990
- var _super = _createSuper$p(QuarterParser);
991
-
992
- function QuarterParser() {
993
- var _this;
994
-
995
- _classCallCheck$p(this, QuarterParser);
996
-
997
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
998
- args[_key] = arguments[_key];
999
- }
1000
-
1001
- _this = _super.call.apply(_super, [this].concat(args));
1002
-
1003
- _defineProperty$p(_assertThisInitialized$p(_this), "priority", 120);
1004
-
1005
- _defineProperty$p(_assertThisInitialized$p(_this), "incompatibleTokens", ['Y', 'R', 'q', 'M', 'L', 'w', 'I', 'd', 'D', 'i', 'e', 'c', 't', 'T']);
1006
-
1007
- return _this;
1008
- }
1009
-
1010
- _createClass$p(QuarterParser, [{
1011
- key: "parse",
1012
- value: function parse(dateString, token, match) {
1013
- switch (token) {
1014
- // 1, 2, 3, 4
1015
- case 'Q':
1016
- case 'QQ':
1017
- // 01, 02, 03, 04
1018
- return parseNDigits(token.length, dateString);
1019
- // 1st, 2nd, 3rd, 4th
1020
-
1021
- case 'Qo':
1022
- return match.ordinalNumber(dateString, {
1023
- unit: 'quarter'
1024
- });
1025
- // Q1, Q2, Q3, Q4
1026
-
1027
- case 'QQQ':
1028
- return match.quarter(dateString, {
1029
- width: 'abbreviated',
1030
- context: 'formatting'
1031
- }) || match.quarter(dateString, {
1032
- width: 'narrow',
1033
- context: 'formatting'
1034
- });
1035
- // 1, 2, 3, 4 (narrow quarter; could be not numerical)
1036
-
1037
- case 'QQQQQ':
1038
- return match.quarter(dateString, {
1039
- width: 'narrow',
1040
- context: 'formatting'
1041
- });
1042
- // 1st quarter, 2nd quarter, ...
1043
-
1044
- case 'QQQQ':
1045
- default:
1046
- return match.quarter(dateString, {
1047
- width: 'wide',
1048
- context: 'formatting'
1049
- }) || match.quarter(dateString, {
1050
- width: 'abbreviated',
1051
- context: 'formatting'
1052
- }) || match.quarter(dateString, {
1053
- width: 'narrow',
1054
- context: 'formatting'
1055
- });
1056
- }
1057
- }
1058
- }, {
1059
- key: "validate",
1060
- value: function validate(_date, value) {
1061
- return value >= 1 && value <= 4;
1062
- }
1063
- }, {
1064
- key: "set",
1065
- value: function set(date, _flags, value) {
1066
- date.setUTCMonth((value - 1) * 3, 1);
1067
- date.setUTCHours(0, 0, 0, 0);
1068
- return date;
1069
- }
1070
- }]);
1071
-
1072
- return QuarterParser;
1073
- }(Parser);
1074
-
1075
- function _typeof$o(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof$o = function _typeof(obj) { return typeof obj; }; } else { _typeof$o = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof$o(obj); }
1076
-
1077
- function _classCallCheck$o(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
1078
-
1079
- function _defineProperties$o(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
1080
-
1081
- function _createClass$o(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties$o(Constructor.prototype, protoProps); if (staticProps) _defineProperties$o(Constructor, staticProps); return Constructor; }
1082
-
1083
- function _inherits$o(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf$o(subClass, superClass); }
1084
-
1085
- function _setPrototypeOf$o(o, p) { _setPrototypeOf$o = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf$o(o, p); }
1086
-
1087
- function _createSuper$o(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$o(); return function _createSuperInternal() { var Super = _getPrototypeOf$o(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf$o(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn$o(this, result); }; }
1088
-
1089
- function _possibleConstructorReturn$o(self, call) { if (call && (_typeof$o(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized$o(self); }
1090
-
1091
- function _assertThisInitialized$o(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
1092
-
1093
- function _isNativeReflectConstruct$o() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
1094
-
1095
- function _getPrototypeOf$o(o) { _getPrototypeOf$o = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf$o(o); }
1096
-
1097
- function _defineProperty$o(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
1098
- var StandAloneQuarterParser = /*#__PURE__*/function (_Parser) {
1099
- _inherits$o(StandAloneQuarterParser, _Parser);
1100
-
1101
- var _super = _createSuper$o(StandAloneQuarterParser);
1102
-
1103
- function StandAloneQuarterParser() {
1104
- var _this;
1105
-
1106
- _classCallCheck$o(this, StandAloneQuarterParser);
1107
-
1108
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
1109
- args[_key] = arguments[_key];
1110
- }
1111
-
1112
- _this = _super.call.apply(_super, [this].concat(args));
1113
-
1114
- _defineProperty$o(_assertThisInitialized$o(_this), "priority", 120);
1115
-
1116
- _defineProperty$o(_assertThisInitialized$o(_this), "incompatibleTokens", ['Y', 'R', 'Q', 'M', 'L', 'w', 'I', 'd', 'D', 'i', 'e', 'c', 't', 'T']);
1117
-
1118
- return _this;
1119
- }
1120
-
1121
- _createClass$o(StandAloneQuarterParser, [{
1122
- key: "parse",
1123
- value: function parse(dateString, token, match) {
1124
- switch (token) {
1125
- // 1, 2, 3, 4
1126
- case 'q':
1127
- case 'qq':
1128
- // 01, 02, 03, 04
1129
- return parseNDigits(token.length, dateString);
1130
- // 1st, 2nd, 3rd, 4th
1131
-
1132
- case 'qo':
1133
- return match.ordinalNumber(dateString, {
1134
- unit: 'quarter'
1135
- });
1136
- // Q1, Q2, Q3, Q4
1137
-
1138
- case 'qqq':
1139
- return match.quarter(dateString, {
1140
- width: 'abbreviated',
1141
- context: 'standalone'
1142
- }) || match.quarter(dateString, {
1143
- width: 'narrow',
1144
- context: 'standalone'
1145
- });
1146
- // 1, 2, 3, 4 (narrow quarter; could be not numerical)
1147
-
1148
- case 'qqqqq':
1149
- return match.quarter(dateString, {
1150
- width: 'narrow',
1151
- context: 'standalone'
1152
- });
1153
- // 1st quarter, 2nd quarter, ...
1154
-
1155
- case 'qqqq':
1156
- default:
1157
- return match.quarter(dateString, {
1158
- width: 'wide',
1159
- context: 'standalone'
1160
- }) || match.quarter(dateString, {
1161
- width: 'abbreviated',
1162
- context: 'standalone'
1163
- }) || match.quarter(dateString, {
1164
- width: 'narrow',
1165
- context: 'standalone'
1166
- });
1167
- }
1168
- }
1169
- }, {
1170
- key: "validate",
1171
- value: function validate(_date, value) {
1172
- return value >= 1 && value <= 4;
1173
- }
1174
- }, {
1175
- key: "set",
1176
- value: function set(date, _flags, value) {
1177
- date.setUTCMonth((value - 1) * 3, 1);
1178
- date.setUTCHours(0, 0, 0, 0);
1179
- return date;
1180
- }
1181
- }]);
1182
-
1183
- return StandAloneQuarterParser;
1184
- }(Parser);
1185
-
1186
- function _typeof$n(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof$n = function _typeof(obj) { return typeof obj; }; } else { _typeof$n = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof$n(obj); }
1187
-
1188
- function _classCallCheck$n(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
1189
-
1190
- function _defineProperties$n(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
1191
-
1192
- function _createClass$n(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties$n(Constructor.prototype, protoProps); if (staticProps) _defineProperties$n(Constructor, staticProps); return Constructor; }
1193
-
1194
- function _inherits$n(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf$n(subClass, superClass); }
1195
-
1196
- function _setPrototypeOf$n(o, p) { _setPrototypeOf$n = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf$n(o, p); }
1197
-
1198
- function _createSuper$n(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$n(); return function _createSuperInternal() { var Super = _getPrototypeOf$n(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf$n(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn$n(this, result); }; }
1199
-
1200
- function _possibleConstructorReturn$n(self, call) { if (call && (_typeof$n(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized$n(self); }
1201
-
1202
- function _assertThisInitialized$n(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
1203
-
1204
- function _isNativeReflectConstruct$n() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
1205
-
1206
- function _getPrototypeOf$n(o) { _getPrototypeOf$n = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf$n(o); }
1207
-
1208
- function _defineProperty$n(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
1209
- var MonthParser = /*#__PURE__*/function (_Parser) {
1210
- _inherits$n(MonthParser, _Parser);
1211
-
1212
- var _super = _createSuper$n(MonthParser);
1213
-
1214
- function MonthParser() {
1215
- var _this;
1216
-
1217
- _classCallCheck$n(this, MonthParser);
1218
-
1219
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
1220
- args[_key] = arguments[_key];
1221
- }
1222
-
1223
- _this = _super.call.apply(_super, [this].concat(args));
1224
-
1225
- _defineProperty$n(_assertThisInitialized$n(_this), "incompatibleTokens", ['Y', 'R', 'q', 'Q', 'L', 'w', 'I', 'D', 'i', 'e', 'c', 't', 'T']);
1226
-
1227
- _defineProperty$n(_assertThisInitialized$n(_this), "priority", 110);
1228
-
1229
- return _this;
1230
- }
1231
-
1232
- _createClass$n(MonthParser, [{
1233
- key: "parse",
1234
- value: function parse(dateString, token, match) {
1235
- var valueCallback = function valueCallback(value) {
1236
- return value - 1;
1237
- };
1238
-
1239
- switch (token) {
1240
- // 1, 2, ..., 12
1241
- case 'M':
1242
- return mapValue(parseNumericPattern(numericPatterns.month, dateString), valueCallback);
1243
- // 01, 02, ..., 12
1244
-
1245
- case 'MM':
1246
- return mapValue(parseNDigits(2, dateString), valueCallback);
1247
- // 1st, 2nd, ..., 12th
1248
-
1249
- case 'Mo':
1250
- return mapValue(match.ordinalNumber(dateString, {
1251
- unit: 'month'
1252
- }), valueCallback);
1253
- // Jan, Feb, ..., Dec
1254
-
1255
- case 'MMM':
1256
- return match.month(dateString, {
1257
- width: 'abbreviated',
1258
- context: 'formatting'
1259
- }) || match.month(dateString, {
1260
- width: 'narrow',
1261
- context: 'formatting'
1262
- });
1263
- // J, F, ..., D
1264
-
1265
- case 'MMMMM':
1266
- return match.month(dateString, {
1267
- width: 'narrow',
1268
- context: 'formatting'
1269
- });
1270
- // January, February, ..., December
1271
-
1272
- case 'MMMM':
1273
- default:
1274
- return match.month(dateString, {
1275
- width: 'wide',
1276
- context: 'formatting'
1277
- }) || match.month(dateString, {
1278
- width: 'abbreviated',
1279
- context: 'formatting'
1280
- }) || match.month(dateString, {
1281
- width: 'narrow',
1282
- context: 'formatting'
1283
- });
1284
- }
1285
- }
1286
- }, {
1287
- key: "validate",
1288
- value: function validate(_date, value) {
1289
- return value >= 0 && value <= 11;
1290
- }
1291
- }, {
1292
- key: "set",
1293
- value: function set(date, _flags, value) {
1294
- date.setUTCMonth(value, 1);
1295
- date.setUTCHours(0, 0, 0, 0);
1296
- return date;
1297
- }
1298
- }]);
1299
-
1300
- return MonthParser;
1301
- }(Parser);
1302
-
1303
- function _typeof$m(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof$m = function _typeof(obj) { return typeof obj; }; } else { _typeof$m = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof$m(obj); }
1304
-
1305
- function _classCallCheck$m(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
1306
-
1307
- function _defineProperties$m(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
1308
-
1309
- function _createClass$m(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties$m(Constructor.prototype, protoProps); if (staticProps) _defineProperties$m(Constructor, staticProps); return Constructor; }
1310
-
1311
- function _inherits$m(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf$m(subClass, superClass); }
1312
-
1313
- function _setPrototypeOf$m(o, p) { _setPrototypeOf$m = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf$m(o, p); }
1314
-
1315
- function _createSuper$m(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$m(); return function _createSuperInternal() { var Super = _getPrototypeOf$m(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf$m(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn$m(this, result); }; }
1316
-
1317
- function _possibleConstructorReturn$m(self, call) { if (call && (_typeof$m(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized$m(self); }
1318
-
1319
- function _assertThisInitialized$m(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
1320
-
1321
- function _isNativeReflectConstruct$m() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
1322
-
1323
- function _getPrototypeOf$m(o) { _getPrototypeOf$m = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf$m(o); }
1324
-
1325
- function _defineProperty$m(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
1326
- var StandAloneMonthParser = /*#__PURE__*/function (_Parser) {
1327
- _inherits$m(StandAloneMonthParser, _Parser);
1328
-
1329
- var _super = _createSuper$m(StandAloneMonthParser);
1330
-
1331
- function StandAloneMonthParser() {
1332
- var _this;
1333
-
1334
- _classCallCheck$m(this, StandAloneMonthParser);
1335
-
1336
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
1337
- args[_key] = arguments[_key];
1338
- }
1339
-
1340
- _this = _super.call.apply(_super, [this].concat(args));
1341
-
1342
- _defineProperty$m(_assertThisInitialized$m(_this), "priority", 110);
1343
-
1344
- _defineProperty$m(_assertThisInitialized$m(_this), "incompatibleTokens", ['Y', 'R', 'q', 'Q', 'M', 'w', 'I', 'D', 'i', 'e', 'c', 't', 'T']);
1345
-
1346
- return _this;
1347
- }
1348
-
1349
- _createClass$m(StandAloneMonthParser, [{
1350
- key: "parse",
1351
- value: function parse(dateString, token, match) {
1352
- var valueCallback = function valueCallback(value) {
1353
- return value - 1;
1354
- };
1355
-
1356
- switch (token) {
1357
- // 1, 2, ..., 12
1358
- case 'L':
1359
- return mapValue(parseNumericPattern(numericPatterns.month, dateString), valueCallback);
1360
- // 01, 02, ..., 12
1361
-
1362
- case 'LL':
1363
- return mapValue(parseNDigits(2, dateString), valueCallback);
1364
- // 1st, 2nd, ..., 12th
1365
-
1366
- case 'Lo':
1367
- return mapValue(match.ordinalNumber(dateString, {
1368
- unit: 'month'
1369
- }), valueCallback);
1370
- // Jan, Feb, ..., Dec
1371
-
1372
- case 'LLL':
1373
- return match.month(dateString, {
1374
- width: 'abbreviated',
1375
- context: 'standalone'
1376
- }) || match.month(dateString, {
1377
- width: 'narrow',
1378
- context: 'standalone'
1379
- });
1380
- // J, F, ..., D
1381
-
1382
- case 'LLLLL':
1383
- return match.month(dateString, {
1384
- width: 'narrow',
1385
- context: 'standalone'
1386
- });
1387
- // January, February, ..., December
1388
-
1389
- case 'LLLL':
1390
- default:
1391
- return match.month(dateString, {
1392
- width: 'wide',
1393
- context: 'standalone'
1394
- }) || match.month(dateString, {
1395
- width: 'abbreviated',
1396
- context: 'standalone'
1397
- }) || match.month(dateString, {
1398
- width: 'narrow',
1399
- context: 'standalone'
1400
- });
1401
- }
1402
- }
1403
- }, {
1404
- key: "validate",
1405
- value: function validate(_date, value) {
1406
- return value >= 0 && value <= 11;
1407
- }
1408
- }, {
1409
- key: "set",
1410
- value: function set(date, _flags, value) {
1411
- date.setUTCMonth(value, 1);
1412
- date.setUTCHours(0, 0, 0, 0);
1413
- return date;
1414
- }
1415
- }]);
1416
-
1417
- return StandAloneMonthParser;
1418
- }(Parser);
1419
-
1420
- function setUTCWeek(dirtyDate, dirtyWeek, options) {
1421
- requiredArgs(2, arguments);
1422
- var date = toDate(dirtyDate);
1423
- var week = toInteger(dirtyWeek);
1424
- var diff = getUTCWeek(date, options) - week;
1425
- date.setUTCDate(date.getUTCDate() - diff * 7);
1426
- return date;
1427
- }
1428
-
1429
- function _typeof$l(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof$l = function _typeof(obj) { return typeof obj; }; } else { _typeof$l = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof$l(obj); }
1430
-
1431
- function _classCallCheck$l(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
1432
-
1433
- function _defineProperties$l(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
1434
-
1435
- function _createClass$l(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties$l(Constructor.prototype, protoProps); if (staticProps) _defineProperties$l(Constructor, staticProps); return Constructor; }
1436
-
1437
- function _inherits$l(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf$l(subClass, superClass); }
1438
-
1439
- function _setPrototypeOf$l(o, p) { _setPrototypeOf$l = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf$l(o, p); }
1440
-
1441
- function _createSuper$l(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$l(); return function _createSuperInternal() { var Super = _getPrototypeOf$l(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf$l(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn$l(this, result); }; }
1442
-
1443
- function _possibleConstructorReturn$l(self, call) { if (call && (_typeof$l(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized$l(self); }
1444
-
1445
- function _assertThisInitialized$l(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
1446
-
1447
- function _isNativeReflectConstruct$l() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
1448
-
1449
- function _getPrototypeOf$l(o) { _getPrototypeOf$l = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf$l(o); }
1450
-
1451
- function _defineProperty$l(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
1452
-
1453
- var LocalWeekParser = /*#__PURE__*/function (_Parser) {
1454
- _inherits$l(LocalWeekParser, _Parser);
1455
-
1456
- var _super = _createSuper$l(LocalWeekParser);
1457
-
1458
- function LocalWeekParser() {
1459
- var _this;
1460
-
1461
- _classCallCheck$l(this, LocalWeekParser);
1462
-
1463
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
1464
- args[_key] = arguments[_key];
1465
- }
1466
-
1467
- _this = _super.call.apply(_super, [this].concat(args));
1468
-
1469
- _defineProperty$l(_assertThisInitialized$l(_this), "priority", 100);
1470
-
1471
- _defineProperty$l(_assertThisInitialized$l(_this), "incompatibleTokens", ['y', 'R', 'u', 'q', 'Q', 'M', 'L', 'I', 'd', 'D', 'i', 't', 'T']);
1472
-
1473
- return _this;
1474
- }
1475
-
1476
- _createClass$l(LocalWeekParser, [{
1477
- key: "parse",
1478
- value: function parse(dateString, token, match) {
1479
- switch (token) {
1480
- case 'w':
1481
- return parseNumericPattern(numericPatterns.week, dateString);
1482
-
1483
- case 'wo':
1484
- return match.ordinalNumber(dateString, {
1485
- unit: 'week'
1486
- });
1487
-
1488
- default:
1489
- return parseNDigits(token.length, dateString);
1490
- }
1491
- }
1492
- }, {
1493
- key: "validate",
1494
- value: function validate(_date, value) {
1495
- return value >= 1 && value <= 53;
1496
- }
1497
- }, {
1498
- key: "set",
1499
- value: function set(date, _flags, value, options) {
1500
- return startOfUTCWeek(setUTCWeek(date, value, options), options);
1501
- }
1502
- }]);
1503
-
1504
- return LocalWeekParser;
1505
- }(Parser);
1506
-
1507
- function setUTCISOWeek(dirtyDate, dirtyISOWeek) {
1508
- requiredArgs(2, arguments);
1509
- var date = toDate(dirtyDate);
1510
- var isoWeek = toInteger(dirtyISOWeek);
1511
- var diff = getUTCISOWeek(date) - isoWeek;
1512
- date.setUTCDate(date.getUTCDate() - diff * 7);
1513
- return date;
1514
- }
1515
-
1516
- function _typeof$k(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof$k = function _typeof(obj) { return typeof obj; }; } else { _typeof$k = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof$k(obj); }
1517
-
1518
- function _classCallCheck$k(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
1519
-
1520
- function _defineProperties$k(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
1521
-
1522
- function _createClass$k(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties$k(Constructor.prototype, protoProps); if (staticProps) _defineProperties$k(Constructor, staticProps); return Constructor; }
1523
-
1524
- function _inherits$k(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf$k(subClass, superClass); }
1525
-
1526
- function _setPrototypeOf$k(o, p) { _setPrototypeOf$k = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf$k(o, p); }
1527
-
1528
- function _createSuper$k(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$k(); return function _createSuperInternal() { var Super = _getPrototypeOf$k(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf$k(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn$k(this, result); }; }
1529
-
1530
- function _possibleConstructorReturn$k(self, call) { if (call && (_typeof$k(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized$k(self); }
1531
-
1532
- function _assertThisInitialized$k(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
1533
-
1534
- function _isNativeReflectConstruct$k() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
1535
-
1536
- function _getPrototypeOf$k(o) { _getPrototypeOf$k = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf$k(o); }
1537
-
1538
- function _defineProperty$k(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
1539
-
1540
- var ISOWeekParser = /*#__PURE__*/function (_Parser) {
1541
- _inherits$k(ISOWeekParser, _Parser);
1542
-
1543
- var _super = _createSuper$k(ISOWeekParser);
1544
-
1545
- function ISOWeekParser() {
1546
- var _this;
1547
-
1548
- _classCallCheck$k(this, ISOWeekParser);
1549
-
1550
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
1551
- args[_key] = arguments[_key];
1552
- }
1553
-
1554
- _this = _super.call.apply(_super, [this].concat(args));
1555
-
1556
- _defineProperty$k(_assertThisInitialized$k(_this), "priority", 100);
1557
-
1558
- _defineProperty$k(_assertThisInitialized$k(_this), "incompatibleTokens", ['y', 'Y', 'u', 'q', 'Q', 'M', 'L', 'w', 'd', 'D', 'e', 'c', 't', 'T']);
1559
-
1560
- return _this;
1561
- }
1562
-
1563
- _createClass$k(ISOWeekParser, [{
1564
- key: "parse",
1565
- value: function parse(dateString, token, match) {
1566
- switch (token) {
1567
- case 'I':
1568
- return parseNumericPattern(numericPatterns.week, dateString);
1569
-
1570
- case 'Io':
1571
- return match.ordinalNumber(dateString, {
1572
- unit: 'week'
1573
- });
1574
-
1575
- default:
1576
- return parseNDigits(token.length, dateString);
1577
- }
1578
- }
1579
- }, {
1580
- key: "validate",
1581
- value: function validate(_date, value) {
1582
- return value >= 1 && value <= 53;
1583
- }
1584
- }, {
1585
- key: "set",
1586
- value: function set(date, _flags, value) {
1587
- return startOfUTCISOWeek(setUTCISOWeek(date, value));
1588
- }
1589
- }]);
1590
-
1591
- return ISOWeekParser;
1592
- }(Parser);
1593
-
1594
- function _typeof$j(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof$j = function _typeof(obj) { return typeof obj; }; } else { _typeof$j = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof$j(obj); }
1595
-
1596
- function _classCallCheck$j(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
1597
-
1598
- function _defineProperties$j(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
1599
-
1600
- function _createClass$j(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties$j(Constructor.prototype, protoProps); if (staticProps) _defineProperties$j(Constructor, staticProps); return Constructor; }
1601
-
1602
- function _inherits$j(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf$j(subClass, superClass); }
1603
-
1604
- function _setPrototypeOf$j(o, p) { _setPrototypeOf$j = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf$j(o, p); }
1605
-
1606
- function _createSuper$j(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$j(); return function _createSuperInternal() { var Super = _getPrototypeOf$j(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf$j(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn$j(this, result); }; }
1607
-
1608
- function _possibleConstructorReturn$j(self, call) { if (call && (_typeof$j(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized$j(self); }
1609
-
1610
- function _assertThisInitialized$j(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
1611
-
1612
- function _isNativeReflectConstruct$j() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
1613
-
1614
- function _getPrototypeOf$j(o) { _getPrototypeOf$j = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf$j(o); }
1615
-
1616
- function _defineProperty$j(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
1617
- var DAYS_IN_MONTH = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
1618
- var DAYS_IN_MONTH_LEAP_YEAR = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; // Day of the month
1619
-
1620
- var DateParser = /*#__PURE__*/function (_Parser) {
1621
- _inherits$j(DateParser, _Parser);
1622
-
1623
- var _super = _createSuper$j(DateParser);
1624
-
1625
- function DateParser() {
1626
- var _this;
1627
-
1628
- _classCallCheck$j(this, DateParser);
1629
-
1630
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
1631
- args[_key] = arguments[_key];
1632
- }
1633
-
1634
- _this = _super.call.apply(_super, [this].concat(args));
1635
-
1636
- _defineProperty$j(_assertThisInitialized$j(_this), "priority", 90);
1637
-
1638
- _defineProperty$j(_assertThisInitialized$j(_this), "subPriority", 1);
1639
-
1640
- _defineProperty$j(_assertThisInitialized$j(_this), "incompatibleTokens", ['Y', 'R', 'q', 'Q', 'w', 'I', 'D', 'i', 'e', 'c', 't', 'T']);
1641
-
1642
- return _this;
1643
- }
1644
-
1645
- _createClass$j(DateParser, [{
1646
- key: "parse",
1647
- value: function parse(dateString, token, match) {
1648
- switch (token) {
1649
- case 'd':
1650
- return parseNumericPattern(numericPatterns.date, dateString);
1651
-
1652
- case 'do':
1653
- return match.ordinalNumber(dateString, {
1654
- unit: 'date'
1655
- });
1656
-
1657
- default:
1658
- return parseNDigits(token.length, dateString);
1659
- }
1660
- }
1661
- }, {
1662
- key: "validate",
1663
- value: function validate(date, value) {
1664
- var year = date.getUTCFullYear();
1665
- var isLeapYear = isLeapYearIndex(year);
1666
- var month = date.getUTCMonth();
1667
-
1668
- if (isLeapYear) {
1669
- return value >= 1 && value <= DAYS_IN_MONTH_LEAP_YEAR[month];
1670
- } else {
1671
- return value >= 1 && value <= DAYS_IN_MONTH[month];
1672
- }
1673
- }
1674
- }, {
1675
- key: "set",
1676
- value: function set(date, _flags, value) {
1677
- date.setUTCDate(value);
1678
- date.setUTCHours(0, 0, 0, 0);
1679
- return date;
1680
- }
1681
- }]);
1682
-
1683
- return DateParser;
1684
- }(Parser);
1685
-
1686
- function _typeof$i(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof$i = function _typeof(obj) { return typeof obj; }; } else { _typeof$i = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof$i(obj); }
1687
-
1688
- function _classCallCheck$i(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
1689
-
1690
- function _defineProperties$i(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
1691
-
1692
- function _createClass$i(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties$i(Constructor.prototype, protoProps); if (staticProps) _defineProperties$i(Constructor, staticProps); return Constructor; }
1693
-
1694
- function _inherits$i(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf$i(subClass, superClass); }
1695
-
1696
- function _setPrototypeOf$i(o, p) { _setPrototypeOf$i = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf$i(o, p); }
1697
-
1698
- function _createSuper$i(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$i(); return function _createSuperInternal() { var Super = _getPrototypeOf$i(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf$i(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn$i(this, result); }; }
1699
-
1700
- function _possibleConstructorReturn$i(self, call) { if (call && (_typeof$i(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized$i(self); }
1701
-
1702
- function _assertThisInitialized$i(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
1703
-
1704
- function _isNativeReflectConstruct$i() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
1705
-
1706
- function _getPrototypeOf$i(o) { _getPrototypeOf$i = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf$i(o); }
1707
-
1708
- function _defineProperty$i(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
1709
- var DayOfYearParser = /*#__PURE__*/function (_Parser) {
1710
- _inherits$i(DayOfYearParser, _Parser);
1711
-
1712
- var _super = _createSuper$i(DayOfYearParser);
1713
-
1714
- function DayOfYearParser() {
1715
- var _this;
1716
-
1717
- _classCallCheck$i(this, DayOfYearParser);
1718
-
1719
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
1720
- args[_key] = arguments[_key];
1721
- }
1722
-
1723
- _this = _super.call.apply(_super, [this].concat(args));
1724
-
1725
- _defineProperty$i(_assertThisInitialized$i(_this), "priority", 90);
1726
-
1727
- _defineProperty$i(_assertThisInitialized$i(_this), "subpriority", 1);
1728
-
1729
- _defineProperty$i(_assertThisInitialized$i(_this), "incompatibleTokens", ['Y', 'R', 'q', 'Q', 'M', 'L', 'w', 'I', 'd', 'E', 'i', 'e', 'c', 't', 'T']);
1730
-
1731
- return _this;
1732
- }
1733
-
1734
- _createClass$i(DayOfYearParser, [{
1735
- key: "parse",
1736
- value: function parse(dateString, token, match) {
1737
- switch (token) {
1738
- case 'D':
1739
- case 'DD':
1740
- return parseNumericPattern(numericPatterns.dayOfYear, dateString);
1741
-
1742
- case 'Do':
1743
- return match.ordinalNumber(dateString, {
1744
- unit: 'date'
1745
- });
1746
-
1747
- default:
1748
- return parseNDigits(token.length, dateString);
1749
- }
1750
- }
1751
- }, {
1752
- key: "validate",
1753
- value: function validate(date, value) {
1754
- var year = date.getUTCFullYear();
1755
- var isLeapYear = isLeapYearIndex(year);
1756
-
1757
- if (isLeapYear) {
1758
- return value >= 1 && value <= 366;
1759
- } else {
1760
- return value >= 1 && value <= 365;
1761
- }
1762
- }
1763
- }, {
1764
- key: "set",
1765
- value: function set(date, _flags, value) {
1766
- date.setUTCMonth(0, value);
1767
- date.setUTCHours(0, 0, 0, 0);
1768
- return date;
1769
- }
1770
- }]);
1771
-
1772
- return DayOfYearParser;
1773
- }(Parser);
1774
-
1775
- function setUTCDay(dirtyDate, dirtyDay, options) {
1776
- var _ref, _ref2, _ref3, _options$weekStartsOn, _options$locale, _options$locale$optio, _defaultOptions$local, _defaultOptions$local2;
1777
-
1778
- requiredArgs(2, arguments);
1779
- var defaultOptions = getDefaultOptions();
1780
- var weekStartsOn = toInteger((_ref = (_ref2 = (_ref3 = (_options$weekStartsOn = options === null || options === void 0 ? void 0 : options.weekStartsOn) !== null && _options$weekStartsOn !== void 0 ? _options$weekStartsOn : options === null || options === void 0 ? void 0 : (_options$locale = options.locale) === null || _options$locale === void 0 ? void 0 : (_options$locale$optio = _options$locale.options) === null || _options$locale$optio === void 0 ? void 0 : _options$locale$optio.weekStartsOn) !== null && _ref3 !== void 0 ? _ref3 : defaultOptions.weekStartsOn) !== null && _ref2 !== void 0 ? _ref2 : (_defaultOptions$local = defaultOptions.locale) === null || _defaultOptions$local === void 0 ? void 0 : (_defaultOptions$local2 = _defaultOptions$local.options) === null || _defaultOptions$local2 === void 0 ? void 0 : _defaultOptions$local2.weekStartsOn) !== null && _ref !== void 0 ? _ref : 0); // Test if weekStartsOn is between 0 and 6 _and_ is not NaN
1781
-
1782
- if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {
1783
- throw new RangeError('weekStartsOn must be between 0 and 6 inclusively');
1784
- }
1785
-
1786
- var date = toDate(dirtyDate);
1787
- var day = toInteger(dirtyDay);
1788
- var currentDay = date.getUTCDay();
1789
- var remainder = day % 7;
1790
- var dayIndex = (remainder + 7) % 7;
1791
- var diff = (dayIndex < weekStartsOn ? 7 : 0) + day - currentDay;
1792
- date.setUTCDate(date.getUTCDate() + diff);
1793
- return date;
1794
- }
1795
-
1796
- function _typeof$h(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof$h = function _typeof(obj) { return typeof obj; }; } else { _typeof$h = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof$h(obj); }
1797
-
1798
- function _classCallCheck$h(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
1799
-
1800
- function _defineProperties$h(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
1801
-
1802
- function _createClass$h(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties$h(Constructor.prototype, protoProps); if (staticProps) _defineProperties$h(Constructor, staticProps); return Constructor; }
1803
-
1804
- function _inherits$h(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf$h(subClass, superClass); }
1805
-
1806
- function _setPrototypeOf$h(o, p) { _setPrototypeOf$h = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf$h(o, p); }
1807
-
1808
- function _createSuper$h(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$h(); return function _createSuperInternal() { var Super = _getPrototypeOf$h(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf$h(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn$h(this, result); }; }
1809
-
1810
- function _possibleConstructorReturn$h(self, call) { if (call && (_typeof$h(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized$h(self); }
1811
-
1812
- function _assertThisInitialized$h(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
1813
-
1814
- function _isNativeReflectConstruct$h() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
1815
-
1816
- function _getPrototypeOf$h(o) { _getPrototypeOf$h = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf$h(o); }
1817
-
1818
- function _defineProperty$h(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
1819
-
1820
- var DayParser = /*#__PURE__*/function (_Parser) {
1821
- _inherits$h(DayParser, _Parser);
1822
-
1823
- var _super = _createSuper$h(DayParser);
1824
-
1825
- function DayParser() {
1826
- var _this;
1827
-
1828
- _classCallCheck$h(this, DayParser);
1829
-
1830
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
1831
- args[_key] = arguments[_key];
1832
- }
1833
-
1834
- _this = _super.call.apply(_super, [this].concat(args));
1835
-
1836
- _defineProperty$h(_assertThisInitialized$h(_this), "priority", 90);
1837
-
1838
- _defineProperty$h(_assertThisInitialized$h(_this), "incompatibleTokens", ['D', 'i', 'e', 'c', 't', 'T']);
1839
-
1840
- return _this;
1841
- }
1842
-
1843
- _createClass$h(DayParser, [{
1844
- key: "parse",
1845
- value: function parse(dateString, token, match) {
1846
- switch (token) {
1847
- // Tue
1848
- case 'E':
1849
- case 'EE':
1850
- case 'EEE':
1851
- return match.day(dateString, {
1852
- width: 'abbreviated',
1853
- context: 'formatting'
1854
- }) || match.day(dateString, {
1855
- width: 'short',
1856
- context: 'formatting'
1857
- }) || match.day(dateString, {
1858
- width: 'narrow',
1859
- context: 'formatting'
1860
- });
1861
- // T
1862
-
1863
- case 'EEEEE':
1864
- return match.day(dateString, {
1865
- width: 'narrow',
1866
- context: 'formatting'
1867
- });
1868
- // Tu
1869
-
1870
- case 'EEEEEE':
1871
- return match.day(dateString, {
1872
- width: 'short',
1873
- context: 'formatting'
1874
- }) || match.day(dateString, {
1875
- width: 'narrow',
1876
- context: 'formatting'
1877
- });
1878
- // Tuesday
1879
-
1880
- case 'EEEE':
1881
- default:
1882
- return match.day(dateString, {
1883
- width: 'wide',
1884
- context: 'formatting'
1885
- }) || match.day(dateString, {
1886
- width: 'abbreviated',
1887
- context: 'formatting'
1888
- }) || match.day(dateString, {
1889
- width: 'short',
1890
- context: 'formatting'
1891
- }) || match.day(dateString, {
1892
- width: 'narrow',
1893
- context: 'formatting'
1894
- });
1895
- }
1896
- }
1897
- }, {
1898
- key: "validate",
1899
- value: function validate(_date, value) {
1900
- return value >= 0 && value <= 6;
1901
- }
1902
- }, {
1903
- key: "set",
1904
- value: function set(date, _flags, value, options) {
1905
- date = setUTCDay(date, value, options);
1906
- date.setUTCHours(0, 0, 0, 0);
1907
- return date;
1908
- }
1909
- }]);
1910
-
1911
- return DayParser;
1912
- }(Parser);
1913
-
1914
- function _typeof$g(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof$g = function _typeof(obj) { return typeof obj; }; } else { _typeof$g = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof$g(obj); }
1915
-
1916
- function _classCallCheck$g(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
1917
-
1918
- function _defineProperties$g(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
1919
-
1920
- function _createClass$g(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties$g(Constructor.prototype, protoProps); if (staticProps) _defineProperties$g(Constructor, staticProps); return Constructor; }
1921
-
1922
- function _inherits$g(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf$g(subClass, superClass); }
1923
-
1924
- function _setPrototypeOf$g(o, p) { _setPrototypeOf$g = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf$g(o, p); }
1925
-
1926
- function _createSuper$g(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$g(); return function _createSuperInternal() { var Super = _getPrototypeOf$g(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf$g(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn$g(this, result); }; }
1927
-
1928
- function _possibleConstructorReturn$g(self, call) { if (call && (_typeof$g(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized$g(self); }
1929
-
1930
- function _assertThisInitialized$g(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
1931
-
1932
- function _isNativeReflectConstruct$g() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
1933
-
1934
- function _getPrototypeOf$g(o) { _getPrototypeOf$g = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf$g(o); }
1935
-
1936
- function _defineProperty$g(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
1937
-
1938
- var LocalDayParser = /*#__PURE__*/function (_Parser) {
1939
- _inherits$g(LocalDayParser, _Parser);
1940
-
1941
- var _super = _createSuper$g(LocalDayParser);
1942
-
1943
- function LocalDayParser() {
1944
- var _this;
1945
-
1946
- _classCallCheck$g(this, LocalDayParser);
1947
-
1948
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
1949
- args[_key] = arguments[_key];
1950
- }
1951
-
1952
- _this = _super.call.apply(_super, [this].concat(args));
1953
-
1954
- _defineProperty$g(_assertThisInitialized$g(_this), "priority", 90);
1955
-
1956
- _defineProperty$g(_assertThisInitialized$g(_this), "incompatibleTokens", ['y', 'R', 'u', 'q', 'Q', 'M', 'L', 'I', 'd', 'D', 'E', 'i', 'c', 't', 'T']);
1957
-
1958
- return _this;
1959
- }
1960
-
1961
- _createClass$g(LocalDayParser, [{
1962
- key: "parse",
1963
- value: function parse(dateString, token, match, options) {
1964
- var valueCallback = function valueCallback(value) {
1965
- var wholeWeekDays = Math.floor((value - 1) / 7) * 7;
1966
- return (value + options.weekStartsOn + 6) % 7 + wholeWeekDays;
1967
- };
1968
-
1969
- switch (token) {
1970
- // 3
1971
- case 'e':
1972
- case 'ee':
1973
- // 03
1974
- return mapValue(parseNDigits(token.length, dateString), valueCallback);
1975
- // 3rd
1976
-
1977
- case 'eo':
1978
- return mapValue(match.ordinalNumber(dateString, {
1979
- unit: 'day'
1980
- }), valueCallback);
1981
- // Tue
1982
-
1983
- case 'eee':
1984
- return match.day(dateString, {
1985
- width: 'abbreviated',
1986
- context: 'formatting'
1987
- }) || match.day(dateString, {
1988
- width: 'short',
1989
- context: 'formatting'
1990
- }) || match.day(dateString, {
1991
- width: 'narrow',
1992
- context: 'formatting'
1993
- });
1994
- // T
1995
-
1996
- case 'eeeee':
1997
- return match.day(dateString, {
1998
- width: 'narrow',
1999
- context: 'formatting'
2000
- });
2001
- // Tu
2002
-
2003
- case 'eeeeee':
2004
- return match.day(dateString, {
2005
- width: 'short',
2006
- context: 'formatting'
2007
- }) || match.day(dateString, {
2008
- width: 'narrow',
2009
- context: 'formatting'
2010
- });
2011
- // Tuesday
2012
-
2013
- case 'eeee':
2014
- default:
2015
- return match.day(dateString, {
2016
- width: 'wide',
2017
- context: 'formatting'
2018
- }) || match.day(dateString, {
2019
- width: 'abbreviated',
2020
- context: 'formatting'
2021
- }) || match.day(dateString, {
2022
- width: 'short',
2023
- context: 'formatting'
2024
- }) || match.day(dateString, {
2025
- width: 'narrow',
2026
- context: 'formatting'
2027
- });
2028
- }
2029
- }
2030
- }, {
2031
- key: "validate",
2032
- value: function validate(_date, value) {
2033
- return value >= 0 && value <= 6;
2034
- }
2035
- }, {
2036
- key: "set",
2037
- value: function set(date, _flags, value, options) {
2038
- date = setUTCDay(date, value, options);
2039
- date.setUTCHours(0, 0, 0, 0);
2040
- return date;
2041
- }
2042
- }]);
2043
-
2044
- return LocalDayParser;
2045
- }(Parser);
2046
-
2047
- function _typeof$f(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof$f = function _typeof(obj) { return typeof obj; }; } else { _typeof$f = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof$f(obj); }
2048
-
2049
- function _classCallCheck$f(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
2050
-
2051
- function _defineProperties$f(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
2052
-
2053
- function _createClass$f(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties$f(Constructor.prototype, protoProps); if (staticProps) _defineProperties$f(Constructor, staticProps); return Constructor; }
2054
-
2055
- function _inherits$f(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf$f(subClass, superClass); }
2056
-
2057
- function _setPrototypeOf$f(o, p) { _setPrototypeOf$f = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf$f(o, p); }
2058
-
2059
- function _createSuper$f(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$f(); return function _createSuperInternal() { var Super = _getPrototypeOf$f(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf$f(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn$f(this, result); }; }
2060
-
2061
- function _possibleConstructorReturn$f(self, call) { if (call && (_typeof$f(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized$f(self); }
2062
-
2063
- function _assertThisInitialized$f(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
2064
-
2065
- function _isNativeReflectConstruct$f() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
2066
-
2067
- function _getPrototypeOf$f(o) { _getPrototypeOf$f = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf$f(o); }
2068
-
2069
- function _defineProperty$f(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2070
-
2071
- var StandAloneLocalDayParser = /*#__PURE__*/function (_Parser) {
2072
- _inherits$f(StandAloneLocalDayParser, _Parser);
2073
-
2074
- var _super = _createSuper$f(StandAloneLocalDayParser);
2075
-
2076
- function StandAloneLocalDayParser() {
2077
- var _this;
2078
-
2079
- _classCallCheck$f(this, StandAloneLocalDayParser);
2080
-
2081
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
2082
- args[_key] = arguments[_key];
2083
- }
2084
-
2085
- _this = _super.call.apply(_super, [this].concat(args));
2086
-
2087
- _defineProperty$f(_assertThisInitialized$f(_this), "priority", 90);
2088
-
2089
- _defineProperty$f(_assertThisInitialized$f(_this), "incompatibleTokens", ['y', 'R', 'u', 'q', 'Q', 'M', 'L', 'I', 'd', 'D', 'E', 'i', 'e', 't', 'T']);
2090
-
2091
- return _this;
2092
- }
2093
-
2094
- _createClass$f(StandAloneLocalDayParser, [{
2095
- key: "parse",
2096
- value: function parse(dateString, token, match, options) {
2097
- var valueCallback = function valueCallback(value) {
2098
- var wholeWeekDays = Math.floor((value - 1) / 7) * 7;
2099
- return (value + options.weekStartsOn + 6) % 7 + wholeWeekDays;
2100
- };
2101
-
2102
- switch (token) {
2103
- // 3
2104
- case 'c':
2105
- case 'cc':
2106
- // 03
2107
- return mapValue(parseNDigits(token.length, dateString), valueCallback);
2108
- // 3rd
2109
-
2110
- case 'co':
2111
- return mapValue(match.ordinalNumber(dateString, {
2112
- unit: 'day'
2113
- }), valueCallback);
2114
- // Tue
2115
-
2116
- case 'ccc':
2117
- return match.day(dateString, {
2118
- width: 'abbreviated',
2119
- context: 'standalone'
2120
- }) || match.day(dateString, {
2121
- width: 'short',
2122
- context: 'standalone'
2123
- }) || match.day(dateString, {
2124
- width: 'narrow',
2125
- context: 'standalone'
2126
- });
2127
- // T
2128
-
2129
- case 'ccccc':
2130
- return match.day(dateString, {
2131
- width: 'narrow',
2132
- context: 'standalone'
2133
- });
2134
- // Tu
2135
-
2136
- case 'cccccc':
2137
- return match.day(dateString, {
2138
- width: 'short',
2139
- context: 'standalone'
2140
- }) || match.day(dateString, {
2141
- width: 'narrow',
2142
- context: 'standalone'
2143
- });
2144
- // Tuesday
2145
-
2146
- case 'cccc':
2147
- default:
2148
- return match.day(dateString, {
2149
- width: 'wide',
2150
- context: 'standalone'
2151
- }) || match.day(dateString, {
2152
- width: 'abbreviated',
2153
- context: 'standalone'
2154
- }) || match.day(dateString, {
2155
- width: 'short',
2156
- context: 'standalone'
2157
- }) || match.day(dateString, {
2158
- width: 'narrow',
2159
- context: 'standalone'
2160
- });
2161
- }
2162
- }
2163
- }, {
2164
- key: "validate",
2165
- value: function validate(_date, value) {
2166
- return value >= 0 && value <= 6;
2167
- }
2168
- }, {
2169
- key: "set",
2170
- value: function set(date, _flags, value, options) {
2171
- date = setUTCDay(date, value, options);
2172
- date.setUTCHours(0, 0, 0, 0);
2173
- return date;
2174
- }
2175
- }]);
2176
-
2177
- return StandAloneLocalDayParser;
2178
- }(Parser);
2179
-
2180
- function setUTCISODay(dirtyDate, dirtyDay) {
2181
- requiredArgs(2, arguments);
2182
- var day = toInteger(dirtyDay);
2183
-
2184
- if (day % 7 === 0) {
2185
- day = day - 7;
2186
- }
2187
-
2188
- var weekStartsOn = 1;
2189
- var date = toDate(dirtyDate);
2190
- var currentDay = date.getUTCDay();
2191
- var remainder = day % 7;
2192
- var dayIndex = (remainder + 7) % 7;
2193
- var diff = (dayIndex < weekStartsOn ? 7 : 0) + day - currentDay;
2194
- date.setUTCDate(date.getUTCDate() + diff);
2195
- return date;
2196
- }
2197
-
2198
- function _typeof$e(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof$e = function _typeof(obj) { return typeof obj; }; } else { _typeof$e = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof$e(obj); }
2199
-
2200
- function _classCallCheck$e(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
2201
-
2202
- function _defineProperties$e(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
2203
-
2204
- function _createClass$e(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties$e(Constructor.prototype, protoProps); if (staticProps) _defineProperties$e(Constructor, staticProps); return Constructor; }
2205
-
2206
- function _inherits$e(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf$e(subClass, superClass); }
2207
-
2208
- function _setPrototypeOf$e(o, p) { _setPrototypeOf$e = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf$e(o, p); }
2209
-
2210
- function _createSuper$e(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$e(); return function _createSuperInternal() { var Super = _getPrototypeOf$e(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf$e(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn$e(this, result); }; }
2211
-
2212
- function _possibleConstructorReturn$e(self, call) { if (call && (_typeof$e(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized$e(self); }
2213
-
2214
- function _assertThisInitialized$e(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
2215
-
2216
- function _isNativeReflectConstruct$e() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
2217
-
2218
- function _getPrototypeOf$e(o) { _getPrototypeOf$e = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf$e(o); }
2219
-
2220
- function _defineProperty$e(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2221
-
2222
- var ISODayParser = /*#__PURE__*/function (_Parser) {
2223
- _inherits$e(ISODayParser, _Parser);
2224
-
2225
- var _super = _createSuper$e(ISODayParser);
2226
-
2227
- function ISODayParser() {
2228
- var _this;
2229
-
2230
- _classCallCheck$e(this, ISODayParser);
2231
-
2232
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
2233
- args[_key] = arguments[_key];
2234
- }
2235
-
2236
- _this = _super.call.apply(_super, [this].concat(args));
2237
-
2238
- _defineProperty$e(_assertThisInitialized$e(_this), "priority", 90);
2239
-
2240
- _defineProperty$e(_assertThisInitialized$e(_this), "incompatibleTokens", ['y', 'Y', 'u', 'q', 'Q', 'M', 'L', 'w', 'd', 'D', 'E', 'e', 'c', 't', 'T']);
2241
-
2242
- return _this;
2243
- }
2244
-
2245
- _createClass$e(ISODayParser, [{
2246
- key: "parse",
2247
- value: function parse(dateString, token, match) {
2248
- var valueCallback = function valueCallback(value) {
2249
- if (value === 0) {
2250
- return 7;
2251
- }
2252
-
2253
- return value;
2254
- };
2255
-
2256
- switch (token) {
2257
- // 2
2258
- case 'i':
2259
- case 'ii':
2260
- // 02
2261
- return parseNDigits(token.length, dateString);
2262
- // 2nd
2263
-
2264
- case 'io':
2265
- return match.ordinalNumber(dateString, {
2266
- unit: 'day'
2267
- });
2268
- // Tue
2269
-
2270
- case 'iii':
2271
- return mapValue(match.day(dateString, {
2272
- width: 'abbreviated',
2273
- context: 'formatting'
2274
- }) || match.day(dateString, {
2275
- width: 'short',
2276
- context: 'formatting'
2277
- }) || match.day(dateString, {
2278
- width: 'narrow',
2279
- context: 'formatting'
2280
- }), valueCallback);
2281
- // T
2282
-
2283
- case 'iiiii':
2284
- return mapValue(match.day(dateString, {
2285
- width: 'narrow',
2286
- context: 'formatting'
2287
- }), valueCallback);
2288
- // Tu
2289
-
2290
- case 'iiiiii':
2291
- return mapValue(match.day(dateString, {
2292
- width: 'short',
2293
- context: 'formatting'
2294
- }) || match.day(dateString, {
2295
- width: 'narrow',
2296
- context: 'formatting'
2297
- }), valueCallback);
2298
- // Tuesday
2299
-
2300
- case 'iiii':
2301
- default:
2302
- return mapValue(match.day(dateString, {
2303
- width: 'wide',
2304
- context: 'formatting'
2305
- }) || match.day(dateString, {
2306
- width: 'abbreviated',
2307
- context: 'formatting'
2308
- }) || match.day(dateString, {
2309
- width: 'short',
2310
- context: 'formatting'
2311
- }) || match.day(dateString, {
2312
- width: 'narrow',
2313
- context: 'formatting'
2314
- }), valueCallback);
2315
- }
2316
- }
2317
- }, {
2318
- key: "validate",
2319
- value: function validate(_date, value) {
2320
- return value >= 1 && value <= 7;
2321
- }
2322
- }, {
2323
- key: "set",
2324
- value: function set(date, _flags, value) {
2325
- date = setUTCISODay(date, value);
2326
- date.setUTCHours(0, 0, 0, 0);
2327
- return date;
2328
- }
2329
- }]);
2330
-
2331
- return ISODayParser;
2332
- }(Parser);
2333
-
2334
- function _typeof$d(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof$d = function _typeof(obj) { return typeof obj; }; } else { _typeof$d = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof$d(obj); }
2335
-
2336
- function _classCallCheck$d(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
2337
-
2338
- function _defineProperties$d(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
2339
-
2340
- function _createClass$d(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties$d(Constructor.prototype, protoProps); if (staticProps) _defineProperties$d(Constructor, staticProps); return Constructor; }
2341
-
2342
- function _inherits$d(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf$d(subClass, superClass); }
2343
-
2344
- function _setPrototypeOf$d(o, p) { _setPrototypeOf$d = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf$d(o, p); }
2345
-
2346
- function _createSuper$d(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$d(); return function _createSuperInternal() { var Super = _getPrototypeOf$d(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf$d(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn$d(this, result); }; }
2347
-
2348
- function _possibleConstructorReturn$d(self, call) { if (call && (_typeof$d(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized$d(self); }
2349
-
2350
- function _assertThisInitialized$d(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
2351
-
2352
- function _isNativeReflectConstruct$d() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
2353
-
2354
- function _getPrototypeOf$d(o) { _getPrototypeOf$d = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf$d(o); }
2355
-
2356
- function _defineProperty$d(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2357
- var AMPMParser = /*#__PURE__*/function (_Parser) {
2358
- _inherits$d(AMPMParser, _Parser);
2359
-
2360
- var _super = _createSuper$d(AMPMParser);
2361
-
2362
- function AMPMParser() {
2363
- var _this;
2364
-
2365
- _classCallCheck$d(this, AMPMParser);
2366
-
2367
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
2368
- args[_key] = arguments[_key];
2369
- }
2370
-
2371
- _this = _super.call.apply(_super, [this].concat(args));
2372
-
2373
- _defineProperty$d(_assertThisInitialized$d(_this), "priority", 80);
2374
-
2375
- _defineProperty$d(_assertThisInitialized$d(_this), "incompatibleTokens", ['b', 'B', 'H', 'k', 't', 'T']);
2376
-
2377
- return _this;
2378
- }
2379
-
2380
- _createClass$d(AMPMParser, [{
2381
- key: "parse",
2382
- value: function parse(dateString, token, match) {
2383
- switch (token) {
2384
- case 'a':
2385
- case 'aa':
2386
- case 'aaa':
2387
- return match.dayPeriod(dateString, {
2388
- width: 'abbreviated',
2389
- context: 'formatting'
2390
- }) || match.dayPeriod(dateString, {
2391
- width: 'narrow',
2392
- context: 'formatting'
2393
- });
2394
-
2395
- case 'aaaaa':
2396
- return match.dayPeriod(dateString, {
2397
- width: 'narrow',
2398
- context: 'formatting'
2399
- });
2400
-
2401
- case 'aaaa':
2402
- default:
2403
- return match.dayPeriod(dateString, {
2404
- width: 'wide',
2405
- context: 'formatting'
2406
- }) || match.dayPeriod(dateString, {
2407
- width: 'abbreviated',
2408
- context: 'formatting'
2409
- }) || match.dayPeriod(dateString, {
2410
- width: 'narrow',
2411
- context: 'formatting'
2412
- });
2413
- }
2414
- }
2415
- }, {
2416
- key: "set",
2417
- value: function set(date, _flags, value) {
2418
- date.setUTCHours(dayPeriodEnumToHours(value), 0, 0, 0);
2419
- return date;
2420
- }
2421
- }]);
2422
-
2423
- return AMPMParser;
2424
- }(Parser);
2425
-
2426
- function _typeof$c(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof$c = function _typeof(obj) { return typeof obj; }; } else { _typeof$c = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof$c(obj); }
2427
-
2428
- function _classCallCheck$c(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
2429
-
2430
- function _defineProperties$c(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
2431
-
2432
- function _createClass$c(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties$c(Constructor.prototype, protoProps); if (staticProps) _defineProperties$c(Constructor, staticProps); return Constructor; }
2433
-
2434
- function _inherits$c(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf$c(subClass, superClass); }
2435
-
2436
- function _setPrototypeOf$c(o, p) { _setPrototypeOf$c = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf$c(o, p); }
2437
-
2438
- function _createSuper$c(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$c(); return function _createSuperInternal() { var Super = _getPrototypeOf$c(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf$c(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn$c(this, result); }; }
2439
-
2440
- function _possibleConstructorReturn$c(self, call) { if (call && (_typeof$c(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized$c(self); }
2441
-
2442
- function _assertThisInitialized$c(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
2443
-
2444
- function _isNativeReflectConstruct$c() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
2445
-
2446
- function _getPrototypeOf$c(o) { _getPrototypeOf$c = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf$c(o); }
2447
-
2448
- function _defineProperty$c(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2449
- var AMPMMidnightParser = /*#__PURE__*/function (_Parser) {
2450
- _inherits$c(AMPMMidnightParser, _Parser);
2451
-
2452
- var _super = _createSuper$c(AMPMMidnightParser);
2453
-
2454
- function AMPMMidnightParser() {
2455
- var _this;
2456
-
2457
- _classCallCheck$c(this, AMPMMidnightParser);
2458
-
2459
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
2460
- args[_key] = arguments[_key];
2461
- }
2462
-
2463
- _this = _super.call.apply(_super, [this].concat(args));
2464
-
2465
- _defineProperty$c(_assertThisInitialized$c(_this), "priority", 80);
2466
-
2467
- _defineProperty$c(_assertThisInitialized$c(_this), "incompatibleTokens", ['a', 'B', 'H', 'k', 't', 'T']);
2468
-
2469
- return _this;
2470
- }
2471
-
2472
- _createClass$c(AMPMMidnightParser, [{
2473
- key: "parse",
2474
- value: function parse(dateString, token, match) {
2475
- switch (token) {
2476
- case 'b':
2477
- case 'bb':
2478
- case 'bbb':
2479
- return match.dayPeriod(dateString, {
2480
- width: 'abbreviated',
2481
- context: 'formatting'
2482
- }) || match.dayPeriod(dateString, {
2483
- width: 'narrow',
2484
- context: 'formatting'
2485
- });
2486
-
2487
- case 'bbbbb':
2488
- return match.dayPeriod(dateString, {
2489
- width: 'narrow',
2490
- context: 'formatting'
2491
- });
2492
-
2493
- case 'bbbb':
2494
- default:
2495
- return match.dayPeriod(dateString, {
2496
- width: 'wide',
2497
- context: 'formatting'
2498
- }) || match.dayPeriod(dateString, {
2499
- width: 'abbreviated',
2500
- context: 'formatting'
2501
- }) || match.dayPeriod(dateString, {
2502
- width: 'narrow',
2503
- context: 'formatting'
2504
- });
2505
- }
2506
- }
2507
- }, {
2508
- key: "set",
2509
- value: function set(date, _flags, value) {
2510
- date.setUTCHours(dayPeriodEnumToHours(value), 0, 0, 0);
2511
- return date;
2512
- }
2513
- }]);
2514
-
2515
- return AMPMMidnightParser;
2516
- }(Parser);
2517
-
2518
- function _typeof$b(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof$b = function _typeof(obj) { return typeof obj; }; } else { _typeof$b = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof$b(obj); }
2519
-
2520
- function _classCallCheck$b(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
2521
-
2522
- function _defineProperties$b(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
2523
-
2524
- function _createClass$b(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties$b(Constructor.prototype, protoProps); if (staticProps) _defineProperties$b(Constructor, staticProps); return Constructor; }
2525
-
2526
- function _inherits$b(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf$b(subClass, superClass); }
2527
-
2528
- function _setPrototypeOf$b(o, p) { _setPrototypeOf$b = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf$b(o, p); }
2529
-
2530
- function _createSuper$b(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$b(); return function _createSuperInternal() { var Super = _getPrototypeOf$b(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf$b(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn$b(this, result); }; }
2531
-
2532
- function _possibleConstructorReturn$b(self, call) { if (call && (_typeof$b(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized$b(self); }
2533
-
2534
- function _assertThisInitialized$b(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
2535
-
2536
- function _isNativeReflectConstruct$b() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
2537
-
2538
- function _getPrototypeOf$b(o) { _getPrototypeOf$b = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf$b(o); }
2539
-
2540
- function _defineProperty$b(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2541
-
2542
- var DayPeriodParser = /*#__PURE__*/function (_Parser) {
2543
- _inherits$b(DayPeriodParser, _Parser);
2544
-
2545
- var _super = _createSuper$b(DayPeriodParser);
2546
-
2547
- function DayPeriodParser() {
2548
- var _this;
2549
-
2550
- _classCallCheck$b(this, DayPeriodParser);
2551
-
2552
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
2553
- args[_key] = arguments[_key];
2554
- }
2555
-
2556
- _this = _super.call.apply(_super, [this].concat(args));
2557
-
2558
- _defineProperty$b(_assertThisInitialized$b(_this), "priority", 80);
2559
-
2560
- _defineProperty$b(_assertThisInitialized$b(_this), "incompatibleTokens", ['a', 'b', 't', 'T']);
2561
-
2562
- return _this;
2563
- }
2564
-
2565
- _createClass$b(DayPeriodParser, [{
2566
- key: "parse",
2567
- value: function parse(dateString, token, match) {
2568
- switch (token) {
2569
- case 'B':
2570
- case 'BB':
2571
- case 'BBB':
2572
- return match.dayPeriod(dateString, {
2573
- width: 'abbreviated',
2574
- context: 'formatting'
2575
- }) || match.dayPeriod(dateString, {
2576
- width: 'narrow',
2577
- context: 'formatting'
2578
- });
2579
-
2580
- case 'BBBBB':
2581
- return match.dayPeriod(dateString, {
2582
- width: 'narrow',
2583
- context: 'formatting'
2584
- });
2585
-
2586
- case 'BBBB':
2587
- default:
2588
- return match.dayPeriod(dateString, {
2589
- width: 'wide',
2590
- context: 'formatting'
2591
- }) || match.dayPeriod(dateString, {
2592
- width: 'abbreviated',
2593
- context: 'formatting'
2594
- }) || match.dayPeriod(dateString, {
2595
- width: 'narrow',
2596
- context: 'formatting'
2597
- });
2598
- }
2599
- }
2600
- }, {
2601
- key: "set",
2602
- value: function set(date, _flags, value) {
2603
- date.setUTCHours(dayPeriodEnumToHours(value), 0, 0, 0);
2604
- return date;
2605
- }
2606
- }]);
2607
-
2608
- return DayPeriodParser;
2609
- }(Parser);
2610
-
2611
- function _typeof$a(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof$a = function _typeof(obj) { return typeof obj; }; } else { _typeof$a = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof$a(obj); }
2612
-
2613
- function _classCallCheck$a(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
2614
-
2615
- function _defineProperties$a(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
2616
-
2617
- function _createClass$a(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties$a(Constructor.prototype, protoProps); if (staticProps) _defineProperties$a(Constructor, staticProps); return Constructor; }
2618
-
2619
- function _inherits$a(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf$a(subClass, superClass); }
2620
-
2621
- function _setPrototypeOf$a(o, p) { _setPrototypeOf$a = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf$a(o, p); }
2622
-
2623
- function _createSuper$a(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$a(); return function _createSuperInternal() { var Super = _getPrototypeOf$a(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf$a(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn$a(this, result); }; }
2624
-
2625
- function _possibleConstructorReturn$a(self, call) { if (call && (_typeof$a(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized$a(self); }
2626
-
2627
- function _assertThisInitialized$a(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
2628
-
2629
- function _isNativeReflectConstruct$a() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
2630
-
2631
- function _getPrototypeOf$a(o) { _getPrototypeOf$a = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf$a(o); }
2632
-
2633
- function _defineProperty$a(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2634
- var Hour1to12Parser = /*#__PURE__*/function (_Parser) {
2635
- _inherits$a(Hour1to12Parser, _Parser);
2636
-
2637
- var _super = _createSuper$a(Hour1to12Parser);
2638
-
2639
- function Hour1to12Parser() {
2640
- var _this;
2641
-
2642
- _classCallCheck$a(this, Hour1to12Parser);
2643
-
2644
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
2645
- args[_key] = arguments[_key];
2646
- }
2647
-
2648
- _this = _super.call.apply(_super, [this].concat(args));
2649
-
2650
- _defineProperty$a(_assertThisInitialized$a(_this), "priority", 70);
2651
-
2652
- _defineProperty$a(_assertThisInitialized$a(_this), "incompatibleTokens", ['H', 'K', 'k', 't', 'T']);
2653
-
2654
- return _this;
2655
- }
2656
-
2657
- _createClass$a(Hour1to12Parser, [{
2658
- key: "parse",
2659
- value: function parse(dateString, token, match) {
2660
- switch (token) {
2661
- case 'h':
2662
- return parseNumericPattern(numericPatterns.hour12h, dateString);
2663
-
2664
- case 'ho':
2665
- return match.ordinalNumber(dateString, {
2666
- unit: 'hour'
2667
- });
2668
-
2669
- default:
2670
- return parseNDigits(token.length, dateString);
2671
- }
2672
- }
2673
- }, {
2674
- key: "validate",
2675
- value: function validate(_date, value) {
2676
- return value >= 1 && value <= 12;
2677
- }
2678
- }, {
2679
- key: "set",
2680
- value: function set(date, _flags, value) {
2681
- var isPM = date.getUTCHours() >= 12;
2682
-
2683
- if (isPM && value < 12) {
2684
- date.setUTCHours(value + 12, 0, 0, 0);
2685
- } else if (!isPM && value === 12) {
2686
- date.setUTCHours(0, 0, 0, 0);
2687
- } else {
2688
- date.setUTCHours(value, 0, 0, 0);
2689
- }
2690
-
2691
- return date;
2692
- }
2693
- }]);
2694
-
2695
- return Hour1to12Parser;
2696
- }(Parser);
2697
-
2698
- function _typeof$9(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof$9 = function _typeof(obj) { return typeof obj; }; } else { _typeof$9 = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof$9(obj); }
2699
-
2700
- function _classCallCheck$9(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
2701
-
2702
- function _defineProperties$9(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
2703
-
2704
- function _createClass$9(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties$9(Constructor.prototype, protoProps); if (staticProps) _defineProperties$9(Constructor, staticProps); return Constructor; }
2705
-
2706
- function _inherits$9(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf$9(subClass, superClass); }
2707
-
2708
- function _setPrototypeOf$9(o, p) { _setPrototypeOf$9 = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf$9(o, p); }
2709
-
2710
- function _createSuper$9(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$9(); return function _createSuperInternal() { var Super = _getPrototypeOf$9(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf$9(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn$9(this, result); }; }
2711
-
2712
- function _possibleConstructorReturn$9(self, call) { if (call && (_typeof$9(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized$9(self); }
2713
-
2714
- function _assertThisInitialized$9(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
2715
-
2716
- function _isNativeReflectConstruct$9() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
2717
-
2718
- function _getPrototypeOf$9(o) { _getPrototypeOf$9 = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf$9(o); }
2719
-
2720
- function _defineProperty$9(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2721
- var Hour0to23Parser = /*#__PURE__*/function (_Parser) {
2722
- _inherits$9(Hour0to23Parser, _Parser);
2723
-
2724
- var _super = _createSuper$9(Hour0to23Parser);
2725
-
2726
- function Hour0to23Parser() {
2727
- var _this;
2728
-
2729
- _classCallCheck$9(this, Hour0to23Parser);
2730
-
2731
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
2732
- args[_key] = arguments[_key];
2733
- }
2734
-
2735
- _this = _super.call.apply(_super, [this].concat(args));
2736
-
2737
- _defineProperty$9(_assertThisInitialized$9(_this), "priority", 70);
2738
-
2739
- _defineProperty$9(_assertThisInitialized$9(_this), "incompatibleTokens", ['a', 'b', 'h', 'K', 'k', 't', 'T']);
2740
-
2741
- return _this;
2742
- }
2743
-
2744
- _createClass$9(Hour0to23Parser, [{
2745
- key: "parse",
2746
- value: function parse(dateString, token, match) {
2747
- switch (token) {
2748
- case 'H':
2749
- return parseNumericPattern(numericPatterns.hour23h, dateString);
2750
-
2751
- case 'Ho':
2752
- return match.ordinalNumber(dateString, {
2753
- unit: 'hour'
2754
- });
2755
-
2756
- default:
2757
- return parseNDigits(token.length, dateString);
2758
- }
2759
- }
2760
- }, {
2761
- key: "validate",
2762
- value: function validate(_date, value) {
2763
- return value >= 0 && value <= 23;
2764
- }
2765
- }, {
2766
- key: "set",
2767
- value: function set(date, _flags, value) {
2768
- date.setUTCHours(value, 0, 0, 0);
2769
- return date;
2770
- }
2771
- }]);
2772
-
2773
- return Hour0to23Parser;
2774
- }(Parser);
2775
-
2776
- function _typeof$8(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof$8 = function _typeof(obj) { return typeof obj; }; } else { _typeof$8 = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof$8(obj); }
2777
-
2778
- function _classCallCheck$8(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
2779
-
2780
- function _defineProperties$8(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
2781
-
2782
- function _createClass$8(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties$8(Constructor.prototype, protoProps); if (staticProps) _defineProperties$8(Constructor, staticProps); return Constructor; }
2783
-
2784
- function _inherits$8(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf$8(subClass, superClass); }
2785
-
2786
- function _setPrototypeOf$8(o, p) { _setPrototypeOf$8 = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf$8(o, p); }
2787
-
2788
- function _createSuper$8(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$8(); return function _createSuperInternal() { var Super = _getPrototypeOf$8(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf$8(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn$8(this, result); }; }
2789
-
2790
- function _possibleConstructorReturn$8(self, call) { if (call && (_typeof$8(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized$8(self); }
2791
-
2792
- function _assertThisInitialized$8(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
2793
-
2794
- function _isNativeReflectConstruct$8() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
2795
-
2796
- function _getPrototypeOf$8(o) { _getPrototypeOf$8 = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf$8(o); }
2797
-
2798
- function _defineProperty$8(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2799
- var Hour0To11Parser = /*#__PURE__*/function (_Parser) {
2800
- _inherits$8(Hour0To11Parser, _Parser);
2801
-
2802
- var _super = _createSuper$8(Hour0To11Parser);
2803
-
2804
- function Hour0To11Parser() {
2805
- var _this;
2806
-
2807
- _classCallCheck$8(this, Hour0To11Parser);
2808
-
2809
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
2810
- args[_key] = arguments[_key];
2811
- }
2812
-
2813
- _this = _super.call.apply(_super, [this].concat(args));
2814
-
2815
- _defineProperty$8(_assertThisInitialized$8(_this), "priority", 70);
2816
-
2817
- _defineProperty$8(_assertThisInitialized$8(_this), "incompatibleTokens", ['h', 'H', 'k', 't', 'T']);
2818
-
2819
- return _this;
2820
- }
2821
-
2822
- _createClass$8(Hour0To11Parser, [{
2823
- key: "parse",
2824
- value: function parse(dateString, token, match) {
2825
- switch (token) {
2826
- case 'K':
2827
- return parseNumericPattern(numericPatterns.hour11h, dateString);
2828
-
2829
- case 'Ko':
2830
- return match.ordinalNumber(dateString, {
2831
- unit: 'hour'
2832
- });
2833
-
2834
- default:
2835
- return parseNDigits(token.length, dateString);
2836
- }
2837
- }
2838
- }, {
2839
- key: "validate",
2840
- value: function validate(_date, value) {
2841
- return value >= 0 && value <= 11;
2842
- }
2843
- }, {
2844
- key: "set",
2845
- value: function set(date, _flags, value) {
2846
- var isPM = date.getUTCHours() >= 12;
2847
-
2848
- if (isPM && value < 12) {
2849
- date.setUTCHours(value + 12, 0, 0, 0);
2850
- } else {
2851
- date.setUTCHours(value, 0, 0, 0);
2852
- }
2853
-
2854
- return date;
2855
- }
2856
- }]);
2857
-
2858
- return Hour0To11Parser;
2859
- }(Parser);
2860
-
2861
- function _typeof$7(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof$7 = function _typeof(obj) { return typeof obj; }; } else { _typeof$7 = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof$7(obj); }
2862
-
2863
- function _classCallCheck$7(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
2864
-
2865
- function _defineProperties$7(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
2866
-
2867
- function _createClass$7(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties$7(Constructor.prototype, protoProps); if (staticProps) _defineProperties$7(Constructor, staticProps); return Constructor; }
2868
-
2869
- function _inherits$7(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf$7(subClass, superClass); }
2870
-
2871
- function _setPrototypeOf$7(o, p) { _setPrototypeOf$7 = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf$7(o, p); }
2872
-
2873
- function _createSuper$7(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$7(); return function _createSuperInternal() { var Super = _getPrototypeOf$7(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf$7(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn$7(this, result); }; }
2874
-
2875
- function _possibleConstructorReturn$7(self, call) { if (call && (_typeof$7(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized$7(self); }
2876
-
2877
- function _assertThisInitialized$7(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
2878
-
2879
- function _isNativeReflectConstruct$7() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
2880
-
2881
- function _getPrototypeOf$7(o) { _getPrototypeOf$7 = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf$7(o); }
2882
-
2883
- function _defineProperty$7(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2884
- var Hour1To24Parser = /*#__PURE__*/function (_Parser) {
2885
- _inherits$7(Hour1To24Parser, _Parser);
2886
-
2887
- var _super = _createSuper$7(Hour1To24Parser);
2888
-
2889
- function Hour1To24Parser() {
2890
- var _this;
2891
-
2892
- _classCallCheck$7(this, Hour1To24Parser);
2893
-
2894
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
2895
- args[_key] = arguments[_key];
2896
- }
2897
-
2898
- _this = _super.call.apply(_super, [this].concat(args));
2899
-
2900
- _defineProperty$7(_assertThisInitialized$7(_this), "priority", 70);
2901
-
2902
- _defineProperty$7(_assertThisInitialized$7(_this), "incompatibleTokens", ['a', 'b', 'h', 'H', 'K', 't', 'T']);
2903
-
2904
- return _this;
2905
- }
2906
-
2907
- _createClass$7(Hour1To24Parser, [{
2908
- key: "parse",
2909
- value: function parse(dateString, token, match) {
2910
- switch (token) {
2911
- case 'k':
2912
- return parseNumericPattern(numericPatterns.hour24h, dateString);
2913
-
2914
- case 'ko':
2915
- return match.ordinalNumber(dateString, {
2916
- unit: 'hour'
2917
- });
2918
-
2919
- default:
2920
- return parseNDigits(token.length, dateString);
2921
- }
2922
- }
2923
- }, {
2924
- key: "validate",
2925
- value: function validate(_date, value) {
2926
- return value >= 1 && value <= 24;
2927
- }
2928
- }, {
2929
- key: "set",
2930
- value: function set(date, _flags, value) {
2931
- var hours = value <= 24 ? value % 24 : value;
2932
- date.setUTCHours(hours, 0, 0, 0);
2933
- return date;
2934
- }
2935
- }]);
2936
-
2937
- return Hour1To24Parser;
2938
- }(Parser);
2939
-
2940
- function _typeof$6(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof$6 = function _typeof(obj) { return typeof obj; }; } else { _typeof$6 = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof$6(obj); }
2941
-
2942
- function _classCallCheck$6(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
2943
-
2944
- function _defineProperties$6(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
2945
-
2946
- function _createClass$6(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties$6(Constructor.prototype, protoProps); if (staticProps) _defineProperties$6(Constructor, staticProps); return Constructor; }
2947
-
2948
- function _inherits$6(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf$6(subClass, superClass); }
2949
-
2950
- function _setPrototypeOf$6(o, p) { _setPrototypeOf$6 = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf$6(o, p); }
2951
-
2952
- function _createSuper$6(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$6(); return function _createSuperInternal() { var Super = _getPrototypeOf$6(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf$6(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn$6(this, result); }; }
2953
-
2954
- function _possibleConstructorReturn$6(self, call) { if (call && (_typeof$6(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized$6(self); }
2955
-
2956
- function _assertThisInitialized$6(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
2957
-
2958
- function _isNativeReflectConstruct$6() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
2959
-
2960
- function _getPrototypeOf$6(o) { _getPrototypeOf$6 = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf$6(o); }
2961
-
2962
- function _defineProperty$6(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2963
- var MinuteParser = /*#__PURE__*/function (_Parser) {
2964
- _inherits$6(MinuteParser, _Parser);
2965
-
2966
- var _super = _createSuper$6(MinuteParser);
2967
-
2968
- function MinuteParser() {
2969
- var _this;
2970
-
2971
- _classCallCheck$6(this, MinuteParser);
2972
-
2973
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
2974
- args[_key] = arguments[_key];
2975
- }
2976
-
2977
- _this = _super.call.apply(_super, [this].concat(args));
2978
-
2979
- _defineProperty$6(_assertThisInitialized$6(_this), "priority", 60);
2980
-
2981
- _defineProperty$6(_assertThisInitialized$6(_this), "incompatibleTokens", ['t', 'T']);
2982
-
2983
- return _this;
2984
- }
2985
-
2986
- _createClass$6(MinuteParser, [{
2987
- key: "parse",
2988
- value: function parse(dateString, token, match) {
2989
- switch (token) {
2990
- case 'm':
2991
- return parseNumericPattern(numericPatterns.minute, dateString);
2992
-
2993
- case 'mo':
2994
- return match.ordinalNumber(dateString, {
2995
- unit: 'minute'
2996
- });
2997
-
2998
- default:
2999
- return parseNDigits(token.length, dateString);
3000
- }
3001
- }
3002
- }, {
3003
- key: "validate",
3004
- value: function validate(_date, value) {
3005
- return value >= 0 && value <= 59;
3006
- }
3007
- }, {
3008
- key: "set",
3009
- value: function set(date, _flags, value) {
3010
- date.setUTCMinutes(value, 0, 0);
3011
- return date;
3012
- }
3013
- }]);
3014
-
3015
- return MinuteParser;
3016
- }(Parser);
3017
-
3018
- function _typeof$5(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof$5 = function _typeof(obj) { return typeof obj; }; } else { _typeof$5 = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof$5(obj); }
3019
-
3020
- function _classCallCheck$5(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
3021
-
3022
- function _defineProperties$5(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
3023
-
3024
- function _createClass$5(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties$5(Constructor.prototype, protoProps); if (staticProps) _defineProperties$5(Constructor, staticProps); return Constructor; }
3025
-
3026
- function _inherits$5(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf$5(subClass, superClass); }
3027
-
3028
- function _setPrototypeOf$5(o, p) { _setPrototypeOf$5 = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf$5(o, p); }
3029
-
3030
- function _createSuper$5(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$5(); return function _createSuperInternal() { var Super = _getPrototypeOf$5(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf$5(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn$5(this, result); }; }
3031
-
3032
- function _possibleConstructorReturn$5(self, call) { if (call && (_typeof$5(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized$5(self); }
3033
-
3034
- function _assertThisInitialized$5(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
3035
-
3036
- function _isNativeReflectConstruct$5() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
3037
-
3038
- function _getPrototypeOf$5(o) { _getPrototypeOf$5 = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf$5(o); }
3039
-
3040
- function _defineProperty$5(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
3041
- var SecondParser = /*#__PURE__*/function (_Parser) {
3042
- _inherits$5(SecondParser, _Parser);
3043
-
3044
- var _super = _createSuper$5(SecondParser);
3045
-
3046
- function SecondParser() {
3047
- var _this;
3048
-
3049
- _classCallCheck$5(this, SecondParser);
3050
-
3051
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
3052
- args[_key] = arguments[_key];
3053
- }
3054
-
3055
- _this = _super.call.apply(_super, [this].concat(args));
3056
-
3057
- _defineProperty$5(_assertThisInitialized$5(_this), "priority", 50);
3058
-
3059
- _defineProperty$5(_assertThisInitialized$5(_this), "incompatibleTokens", ['t', 'T']);
3060
-
3061
- return _this;
3062
- }
3063
-
3064
- _createClass$5(SecondParser, [{
3065
- key: "parse",
3066
- value: function parse(dateString, token, match) {
3067
- switch (token) {
3068
- case 's':
3069
- return parseNumericPattern(numericPatterns.second, dateString);
3070
-
3071
- case 'so':
3072
- return match.ordinalNumber(dateString, {
3073
- unit: 'second'
3074
- });
3075
-
3076
- default:
3077
- return parseNDigits(token.length, dateString);
3078
- }
3079
- }
3080
- }, {
3081
- key: "validate",
3082
- value: function validate(_date, value) {
3083
- return value >= 0 && value <= 59;
3084
- }
3085
- }, {
3086
- key: "set",
3087
- value: function set(date, _flags, value) {
3088
- date.setUTCSeconds(value, 0);
3089
- return date;
3090
- }
3091
- }]);
3092
-
3093
- return SecondParser;
3094
- }(Parser);
3095
-
3096
- function _typeof$4(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof$4 = function _typeof(obj) { return typeof obj; }; } else { _typeof$4 = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof$4(obj); }
3097
-
3098
- function _classCallCheck$4(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
3099
-
3100
- function _defineProperties$4(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
3101
-
3102
- function _createClass$4(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties$4(Constructor.prototype, protoProps); if (staticProps) _defineProperties$4(Constructor, staticProps); return Constructor; }
3103
-
3104
- function _inherits$4(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf$4(subClass, superClass); }
3105
-
3106
- function _setPrototypeOf$4(o, p) { _setPrototypeOf$4 = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf$4(o, p); }
3107
-
3108
- function _createSuper$4(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$4(); return function _createSuperInternal() { var Super = _getPrototypeOf$4(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf$4(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn$4(this, result); }; }
3109
-
3110
- function _possibleConstructorReturn$4(self, call) { if (call && (_typeof$4(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized$4(self); }
3111
-
3112
- function _assertThisInitialized$4(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
3113
-
3114
- function _isNativeReflectConstruct$4() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
3115
-
3116
- function _getPrototypeOf$4(o) { _getPrototypeOf$4 = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf$4(o); }
3117
-
3118
- function _defineProperty$4(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
3119
- var FractionOfSecondParser = /*#__PURE__*/function (_Parser) {
3120
- _inherits$4(FractionOfSecondParser, _Parser);
3121
-
3122
- var _super = _createSuper$4(FractionOfSecondParser);
3123
-
3124
- function FractionOfSecondParser() {
3125
- var _this;
3126
-
3127
- _classCallCheck$4(this, FractionOfSecondParser);
3128
-
3129
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
3130
- args[_key] = arguments[_key];
3131
- }
3132
-
3133
- _this = _super.call.apply(_super, [this].concat(args));
3134
-
3135
- _defineProperty$4(_assertThisInitialized$4(_this), "priority", 30);
3136
-
3137
- _defineProperty$4(_assertThisInitialized$4(_this), "incompatibleTokens", ['t', 'T']);
3138
-
3139
- return _this;
3140
- }
3141
-
3142
- _createClass$4(FractionOfSecondParser, [{
3143
- key: "parse",
3144
- value: function parse(dateString, token) {
3145
- var valueCallback = function valueCallback(value) {
3146
- return Math.floor(value * Math.pow(10, -token.length + 3));
3147
- };
3148
-
3149
- return mapValue(parseNDigits(token.length, dateString), valueCallback);
3150
- }
3151
- }, {
3152
- key: "set",
3153
- value: function set(date, _flags, value) {
3154
- date.setUTCMilliseconds(value);
3155
- return date;
3156
- }
3157
- }]);
3158
-
3159
- return FractionOfSecondParser;
3160
- }(Parser);
3161
-
3162
- function _typeof$3(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof$3 = function _typeof(obj) { return typeof obj; }; } else { _typeof$3 = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof$3(obj); }
3163
-
3164
- function _classCallCheck$3(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
3165
-
3166
- function _defineProperties$3(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
3167
-
3168
- function _createClass$3(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties$3(Constructor.prototype, protoProps); if (staticProps) _defineProperties$3(Constructor, staticProps); return Constructor; }
3169
-
3170
- function _inherits$3(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf$3(subClass, superClass); }
3171
-
3172
- function _setPrototypeOf$3(o, p) { _setPrototypeOf$3 = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf$3(o, p); }
3173
-
3174
- function _createSuper$3(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$3(); return function _createSuperInternal() { var Super = _getPrototypeOf$3(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf$3(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn$3(this, result); }; }
3175
-
3176
- function _possibleConstructorReturn$3(self, call) { if (call && (_typeof$3(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized$3(self); }
3177
-
3178
- function _assertThisInitialized$3(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
3179
-
3180
- function _isNativeReflectConstruct$3() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
3181
-
3182
- function _getPrototypeOf$3(o) { _getPrototypeOf$3 = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf$3(o); }
3183
-
3184
- function _defineProperty$3(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
3185
-
3186
- var ISOTimezoneWithZParser = /*#__PURE__*/function (_Parser) {
3187
- _inherits$3(ISOTimezoneWithZParser, _Parser);
3188
-
3189
- var _super = _createSuper$3(ISOTimezoneWithZParser);
3190
-
3191
- function ISOTimezoneWithZParser() {
3192
- var _this;
3193
-
3194
- _classCallCheck$3(this, ISOTimezoneWithZParser);
3195
-
3196
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
3197
- args[_key] = arguments[_key];
3198
- }
3199
-
3200
- _this = _super.call.apply(_super, [this].concat(args));
3201
-
3202
- _defineProperty$3(_assertThisInitialized$3(_this), "priority", 10);
3203
-
3204
- _defineProperty$3(_assertThisInitialized$3(_this), "incompatibleTokens", ['t', 'T', 'x']);
3205
-
3206
- return _this;
3207
- }
3208
-
3209
- _createClass$3(ISOTimezoneWithZParser, [{
3210
- key: "parse",
3211
- value: function parse(dateString, token) {
3212
- switch (token) {
3213
- case 'X':
3214
- return parseTimezonePattern(timezonePatterns.basicOptionalMinutes, dateString);
3215
-
3216
- case 'XX':
3217
- return parseTimezonePattern(timezonePatterns.basic, dateString);
3218
-
3219
- case 'XXXX':
3220
- return parseTimezonePattern(timezonePatterns.basicOptionalSeconds, dateString);
3221
-
3222
- case 'XXXXX':
3223
- return parseTimezonePattern(timezonePatterns.extendedOptionalSeconds, dateString);
3224
-
3225
- case 'XXX':
3226
- default:
3227
- return parseTimezonePattern(timezonePatterns.extended, dateString);
3228
- }
3229
- }
3230
- }, {
3231
- key: "set",
3232
- value: function set(date, flags, value) {
3233
- if (flags.timestampIsSet) {
3234
- return date;
3235
- }
3236
-
3237
- return new Date(date.getTime() - value);
3238
- }
3239
- }]);
3240
-
3241
- return ISOTimezoneWithZParser;
3242
- }(Parser);
3243
-
3244
- function _typeof$2(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof$2 = function _typeof(obj) { return typeof obj; }; } else { _typeof$2 = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof$2(obj); }
3245
-
3246
- function _classCallCheck$2(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
3247
-
3248
- function _defineProperties$2(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
3249
-
3250
- function _createClass$2(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties$2(Constructor.prototype, protoProps); if (staticProps) _defineProperties$2(Constructor, staticProps); return Constructor; }
3251
-
3252
- function _inherits$2(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf$2(subClass, superClass); }
3253
-
3254
- function _setPrototypeOf$2(o, p) { _setPrototypeOf$2 = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf$2(o, p); }
3255
-
3256
- function _createSuper$2(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$2(); return function _createSuperInternal() { var Super = _getPrototypeOf$2(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf$2(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn$2(this, result); }; }
3257
-
3258
- function _possibleConstructorReturn$2(self, call) { if (call && (_typeof$2(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized$2(self); }
3259
-
3260
- function _assertThisInitialized$2(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
3261
-
3262
- function _isNativeReflectConstruct$2() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
3263
-
3264
- function _getPrototypeOf$2(o) { _getPrototypeOf$2 = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf$2(o); }
3265
-
3266
- function _defineProperty$2(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
3267
-
3268
- var ISOTimezoneParser = /*#__PURE__*/function (_Parser) {
3269
- _inherits$2(ISOTimezoneParser, _Parser);
3270
-
3271
- var _super = _createSuper$2(ISOTimezoneParser);
3272
-
3273
- function ISOTimezoneParser() {
3274
- var _this;
3275
-
3276
- _classCallCheck$2(this, ISOTimezoneParser);
3277
-
3278
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
3279
- args[_key] = arguments[_key];
3280
- }
3281
-
3282
- _this = _super.call.apply(_super, [this].concat(args));
3283
-
3284
- _defineProperty$2(_assertThisInitialized$2(_this), "priority", 10);
3285
-
3286
- _defineProperty$2(_assertThisInitialized$2(_this), "incompatibleTokens", ['t', 'T', 'X']);
3287
-
3288
- return _this;
3289
- }
3290
-
3291
- _createClass$2(ISOTimezoneParser, [{
3292
- key: "parse",
3293
- value: function parse(dateString, token) {
3294
- switch (token) {
3295
- case 'x':
3296
- return parseTimezonePattern(timezonePatterns.basicOptionalMinutes, dateString);
3297
-
3298
- case 'xx':
3299
- return parseTimezonePattern(timezonePatterns.basic, dateString);
3300
-
3301
- case 'xxxx':
3302
- return parseTimezonePattern(timezonePatterns.basicOptionalSeconds, dateString);
3303
-
3304
- case 'xxxxx':
3305
- return parseTimezonePattern(timezonePatterns.extendedOptionalSeconds, dateString);
3306
-
3307
- case 'xxx':
3308
- default:
3309
- return parseTimezonePattern(timezonePatterns.extended, dateString);
3310
- }
3311
- }
3312
- }, {
3313
- key: "set",
3314
- value: function set(date, flags, value) {
3315
- if (flags.timestampIsSet) {
3316
- return date;
3317
- }
3318
-
3319
- return new Date(date.getTime() - value);
3320
- }
3321
- }]);
3322
-
3323
- return ISOTimezoneParser;
3324
- }(Parser);
3325
-
3326
- function _typeof$1(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof$1 = function _typeof(obj) { return typeof obj; }; } else { _typeof$1 = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof$1(obj); }
3327
-
3328
- function _classCallCheck$1(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
3329
-
3330
- function _defineProperties$1(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
3331
-
3332
- function _createClass$1(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties$1(Constructor.prototype, protoProps); if (staticProps) _defineProperties$1(Constructor, staticProps); return Constructor; }
3333
-
3334
- function _inherits$1(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf$1(subClass, superClass); }
3335
-
3336
- function _setPrototypeOf$1(o, p) { _setPrototypeOf$1 = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf$1(o, p); }
3337
-
3338
- function _createSuper$1(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$1(); return function _createSuperInternal() { var Super = _getPrototypeOf$1(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf$1(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn$1(this, result); }; }
3339
-
3340
- function _possibleConstructorReturn$1(self, call) { if (call && (_typeof$1(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized$1(self); }
3341
-
3342
- function _assertThisInitialized$1(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
3343
-
3344
- function _isNativeReflectConstruct$1() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
3345
-
3346
- function _getPrototypeOf$1(o) { _getPrototypeOf$1 = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf$1(o); }
3347
-
3348
- function _defineProperty$1(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
3349
- var TimestampSecondsParser = /*#__PURE__*/function (_Parser) {
3350
- _inherits$1(TimestampSecondsParser, _Parser);
3351
-
3352
- var _super = _createSuper$1(TimestampSecondsParser);
3353
-
3354
- function TimestampSecondsParser() {
3355
- var _this;
3356
-
3357
- _classCallCheck$1(this, TimestampSecondsParser);
3358
-
3359
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
3360
- args[_key] = arguments[_key];
3361
- }
3362
-
3363
- _this = _super.call.apply(_super, [this].concat(args));
3364
-
3365
- _defineProperty$1(_assertThisInitialized$1(_this), "priority", 40);
3366
-
3367
- _defineProperty$1(_assertThisInitialized$1(_this), "incompatibleTokens", '*');
3368
-
3369
- return _this;
3370
- }
3371
-
3372
- _createClass$1(TimestampSecondsParser, [{
3373
- key: "parse",
3374
- value: function parse(dateString) {
3375
- return parseAnyDigitsSigned(dateString);
3376
- }
3377
- }, {
3378
- key: "set",
3379
- value: function set(_date, _flags, value) {
3380
- return [new Date(value * 1000), {
3381
- timestampIsSet: true
3382
- }];
3383
- }
3384
- }]);
3385
-
3386
- return TimestampSecondsParser;
3387
- }(Parser);
3388
-
3389
- function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
3390
-
3391
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
3392
-
3393
- function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
3394
-
3395
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
3396
-
3397
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
3398
-
3399
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
3400
-
3401
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
3402
-
3403
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
3404
-
3405
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
3406
-
3407
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
3408
-
3409
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
3410
-
3411
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
3412
- var TimestampMillisecondsParser = /*#__PURE__*/function (_Parser) {
3413
- _inherits(TimestampMillisecondsParser, _Parser);
3414
-
3415
- var _super = _createSuper(TimestampMillisecondsParser);
3416
-
3417
- function TimestampMillisecondsParser() {
3418
- var _this;
3419
-
3420
- _classCallCheck(this, TimestampMillisecondsParser);
3421
-
3422
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
3423
- args[_key] = arguments[_key];
3424
- }
3425
-
3426
- _this = _super.call.apply(_super, [this].concat(args));
3427
-
3428
- _defineProperty(_assertThisInitialized(_this), "priority", 20);
3429
-
3430
- _defineProperty(_assertThisInitialized(_this), "incompatibleTokens", '*');
3431
-
3432
- return _this;
3433
- }
3434
-
3435
- _createClass(TimestampMillisecondsParser, [{
3436
- key: "parse",
3437
- value: function parse(dateString) {
3438
- return parseAnyDigitsSigned(dateString);
3439
- }
3440
- }, {
3441
- key: "set",
3442
- value: function set(_date, _flags, value) {
3443
- return [new Date(value), {
3444
- timestampIsSet: true
3445
- }];
3446
- }
3447
- }]);
3448
-
3449
- return TimestampMillisecondsParser;
3450
- }(Parser);
3451
-
3452
- /*
3453
- * | | Unit | | Unit |
3454
- * |-----|--------------------------------|-----|--------------------------------|
3455
- * | a | AM, PM | A* | Milliseconds in day |
3456
- * | b | AM, PM, noon, midnight | B | Flexible day period |
3457
- * | c | Stand-alone local day of week | C* | Localized hour w/ day period |
3458
- * | d | Day of month | D | Day of year |
3459
- * | e | Local day of week | E | Day of week |
3460
- * | f | | F* | Day of week in month |
3461
- * | g* | Modified Julian day | G | Era |
3462
- * | h | Hour [1-12] | H | Hour [0-23] |
3463
- * | i! | ISO day of week | I! | ISO week of year |
3464
- * | j* | Localized hour w/ day period | J* | Localized hour w/o day period |
3465
- * | k | Hour [1-24] | K | Hour [0-11] |
3466
- * | l* | (deprecated) | L | Stand-alone month |
3467
- * | m | Minute | M | Month |
3468
- * | n | | N | |
3469
- * | o! | Ordinal number modifier | O* | Timezone (GMT) |
3470
- * | p | | P | |
3471
- * | q | Stand-alone quarter | Q | Quarter |
3472
- * | r* | Related Gregorian year | R! | ISO week-numbering year |
3473
- * | s | Second | S | Fraction of second |
3474
- * | t! | Seconds timestamp | T! | Milliseconds timestamp |
3475
- * | u | Extended year | U* | Cyclic year |
3476
- * | v* | Timezone (generic non-locat.) | V* | Timezone (location) |
3477
- * | w | Local week of year | W* | Week of month |
3478
- * | x | Timezone (ISO-8601 w/o Z) | X | Timezone (ISO-8601) |
3479
- * | y | Year (abs) | Y | Local week-numbering year |
3480
- * | z* | Timezone (specific non-locat.) | Z* | Timezone (aliases) |
3481
- *
3482
- * Letters marked by * are not implemented but reserved by Unicode standard.
3483
- *
3484
- * Letters marked by ! are non-standard, but implemented by date-fns:
3485
- * - `o` modifies the previous token to turn it into an ordinal (see `parse` docs)
3486
- * - `i` is ISO day of week. For `i` and `ii` is returns numeric ISO week days,
3487
- * i.e. 7 for Sunday, 1 for Monday, etc.
3488
- * - `I` is ISO week of year, as opposed to `w` which is local week of year.
3489
- * - `R` is ISO week-numbering year, as opposed to `Y` which is local week-numbering year.
3490
- * `R` is supposed to be used in conjunction with `I` and `i`
3491
- * for universal ISO week-numbering date, whereas
3492
- * `Y` is supposed to be used in conjunction with `w` and `e`
3493
- * for week-numbering date specific to the locale.
3494
- */
3495
-
3496
- ({
3497
- G: new EraParser(),
3498
- y: new YearParser(),
3499
- Y: new LocalWeekYearParser(),
3500
- R: new ISOWeekYearParser(),
3501
- u: new ExtendedYearParser(),
3502
- Q: new QuarterParser(),
3503
- q: new StandAloneQuarterParser(),
3504
- M: new MonthParser(),
3505
- L: new StandAloneMonthParser(),
3506
- w: new LocalWeekParser(),
3507
- I: new ISOWeekParser(),
3508
- d: new DateParser(),
3509
- D: new DayOfYearParser(),
3510
- E: new DayParser(),
3511
- e: new LocalDayParser(),
3512
- c: new StandAloneLocalDayParser(),
3513
- i: new ISODayParser(),
3514
- a: new AMPMParser(),
3515
- b: new AMPMMidnightParser(),
3516
- B: new DayPeriodParser(),
3517
- h: new Hour1to12Parser(),
3518
- H: new Hour0to23Parser(),
3519
- K: new Hour0To11Parser(),
3520
- k: new Hour1To24Parser(),
3521
- m: new MinuteParser(),
3522
- s: new SecondParser(),
3523
- S: new FractionOfSecondParser(),
3524
- X: new ISOTimezoneWithZParser(),
3525
- x: new ISOTimezoneParser(),
3526
- t: new TimestampSecondsParser(),
3527
- T: new TimestampMillisecondsParser()
3528
- });
3529
-
3530
- exports.getDefaultOptions = getDefaultOptions;
3531
- exports.getUTCISOWeek = getUTCISOWeek;
3532
- exports.getUTCISOWeekYear = getUTCISOWeekYear;
3533
- exports.getUTCWeek = getUTCWeek;
3534
- exports.getUTCWeekYear = getUTCWeekYear;
3535
- exports.requiredArgs = requiredArgs;
3536
- exports.toDate = toDate;
3537
- exports.toInteger = toInteger;
3538
- //# sourceMappingURL=index-a961acab.js.map