@internationalized/date 3.11.0 → 3.12.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (171) hide show
  1. package/dist/index.cjs +113 -0
  2. package/dist/index.cjs.map +1 -0
  3. package/dist/index.js +45 -0
  4. package/dist/index.js.map +1 -0
  5. package/dist/index.mjs +45 -0
  6. package/dist/index.mjs.map +1 -0
  7. package/dist/{CalendarDate.main.js → private/CalendarDate.cjs} +102 -120
  8. package/dist/private/CalendarDate.cjs.map +1 -0
  9. package/dist/{CalendarDate.mjs → private/CalendarDate.js} +65 -65
  10. package/dist/private/CalendarDate.js.map +1 -0
  11. package/dist/{CalendarDate.module.js → private/CalendarDate.mjs} +99 -117
  12. package/dist/private/CalendarDate.mjs.map +1 -0
  13. package/dist/{DateFormatter.main.js → private/DateFormatter.cjs} +27 -27
  14. package/dist/private/DateFormatter.cjs.map +1 -0
  15. package/dist/{DateFormatter.module.js → private/DateFormatter.js} +23 -23
  16. package/dist/{DateFormatter.module.js.map → private/DateFormatter.js.map} +1 -1
  17. package/dist/{DateFormatter.mjs → private/DateFormatter.mjs} +27 -27
  18. package/dist/private/DateFormatter.mjs.map +1 -0
  19. package/dist/{BuddhistCalendar.main.js → private/calendars/BuddhistCalendar.cjs} +13 -13
  20. package/dist/{BuddhistCalendar.main.js.map → private/calendars/BuddhistCalendar.cjs.map} +1 -1
  21. package/dist/{BuddhistCalendar.module.js → private/calendars/BuddhistCalendar.js} +13 -13
  22. package/dist/{BuddhistCalendar.module.js.map → private/calendars/BuddhistCalendar.js.map} +1 -1
  23. package/dist/{BuddhistCalendar.mjs → private/calendars/BuddhistCalendar.mjs} +13 -13
  24. package/dist/private/calendars/BuddhistCalendar.mjs.map +1 -0
  25. package/dist/{EthiopicCalendar.main.js → private/calendars/EthiopicCalendar.cjs} +32 -32
  26. package/dist/{EthiopicCalendar.main.js.map → private/calendars/EthiopicCalendar.cjs.map} +1 -1
  27. package/dist/{EthiopicCalendar.module.js → private/calendars/EthiopicCalendar.js} +30 -30
  28. package/dist/{EthiopicCalendar.module.js.map → private/calendars/EthiopicCalendar.js.map} +1 -1
  29. package/dist/{EthiopicCalendar.mjs → private/calendars/EthiopicCalendar.mjs} +30 -30
  30. package/dist/private/calendars/EthiopicCalendar.mjs.map +1 -0
  31. package/dist/{GregorianCalendar.main.js → private/calendars/GregorianCalendar.cjs} +31 -31
  32. package/dist/{GregorianCalendar.main.js.map → private/calendars/GregorianCalendar.cjs.map} +1 -1
  33. package/dist/{GregorianCalendar.module.js → private/calendars/GregorianCalendar.js} +27 -27
  34. package/dist/{GregorianCalendar.module.js.map → private/calendars/GregorianCalendar.js.map} +1 -1
  35. package/dist/{GregorianCalendar.mjs → private/calendars/GregorianCalendar.mjs} +27 -27
  36. package/dist/private/calendars/GregorianCalendar.mjs.map +1 -0
  37. package/dist/{HebrewCalendar.main.js → private/calendars/HebrewCalendar.cjs} +44 -44
  38. package/dist/{HebrewCalendar.main.js.map → private/calendars/HebrewCalendar.cjs.map} +1 -1
  39. package/dist/{HebrewCalendar.module.js → private/calendars/HebrewCalendar.js} +44 -44
  40. package/dist/{HebrewCalendar.module.js.map → private/calendars/HebrewCalendar.js.map} +1 -1
  41. package/dist/{HebrewCalendar.mjs → private/calendars/HebrewCalendar.mjs} +44 -44
  42. package/dist/private/calendars/HebrewCalendar.mjs.map +1 -0
  43. package/dist/{IndianCalendar.main.js → private/calendars/IndianCalendar.cjs} +20 -20
  44. package/dist/{IndianCalendar.main.js.map → private/calendars/IndianCalendar.cjs.map} +1 -1
  45. package/dist/{IndianCalendar.module.js → private/calendars/IndianCalendar.js} +20 -20
  46. package/dist/{IndianCalendar.module.js.map → private/calendars/IndianCalendar.js.map} +1 -1
  47. package/dist/{IndianCalendar.mjs → private/calendars/IndianCalendar.mjs} +20 -20
  48. package/dist/private/calendars/IndianCalendar.mjs.map +1 -0
  49. package/dist/private/calendars/IslamicCalendar.cjs +168 -0
  50. package/dist/private/calendars/IslamicCalendar.cjs.map +1 -0
  51. package/dist/private/calendars/IslamicCalendar.js +161 -0
  52. package/dist/{IslamicCalendar.module.js.map → private/calendars/IslamicCalendar.js.map} +1 -1
  53. package/dist/private/calendars/IslamicCalendar.mjs +161 -0
  54. package/dist/private/calendars/IslamicCalendar.mjs.map +1 -0
  55. package/dist/{JapaneseCalendar.main.js → private/calendars/JapaneseCalendar.cjs} +37 -37
  56. package/dist/{JapaneseCalendar.main.js.map → private/calendars/JapaneseCalendar.cjs.map} +1 -1
  57. package/dist/{JapaneseCalendar.module.js → private/calendars/JapaneseCalendar.js} +37 -37
  58. package/dist/{JapaneseCalendar.module.js.map → private/calendars/JapaneseCalendar.js.map} +1 -1
  59. package/dist/{JapaneseCalendar.mjs → private/calendars/JapaneseCalendar.mjs} +37 -37
  60. package/dist/private/calendars/JapaneseCalendar.mjs.map +1 -0
  61. package/dist/{PersianCalendar.main.js → private/calendars/PersianCalendar.cjs} +13 -13
  62. package/dist/{PersianCalendar.main.js.map → private/calendars/PersianCalendar.cjs.map} +1 -1
  63. package/dist/{PersianCalendar.module.js → private/calendars/PersianCalendar.js} +13 -13
  64. package/dist/{PersianCalendar.module.js.map → private/calendars/PersianCalendar.js.map} +1 -1
  65. package/dist/{PersianCalendar.mjs → private/calendars/PersianCalendar.mjs} +13 -13
  66. package/dist/private/calendars/PersianCalendar.mjs.map +1 -0
  67. package/dist/{TaiwanCalendar.main.js → private/calendars/TaiwanCalendar.cjs} +20 -20
  68. package/dist/{TaiwanCalendar.main.js.map → private/calendars/TaiwanCalendar.cjs.map} +1 -1
  69. package/dist/private/calendars/TaiwanCalendar.js +75 -0
  70. package/dist/{TaiwanCalendar.module.js.map → private/calendars/TaiwanCalendar.js.map} +1 -1
  71. package/dist/{TaiwanCalendar.mjs → private/calendars/TaiwanCalendar.mjs} +20 -20
  72. package/dist/private/calendars/TaiwanCalendar.mjs.map +1 -0
  73. package/dist/private/conversion.cjs +241 -0
  74. package/dist/private/conversion.cjs.map +1 -0
  75. package/dist/private/conversion.js +222 -0
  76. package/dist/private/conversion.js.map +1 -0
  77. package/dist/private/conversion.mjs +222 -0
  78. package/dist/private/conversion.mjs.map +1 -0
  79. package/dist/private/createCalendar.cjs +69 -0
  80. package/dist/{createCalendar.main.js.map → private/createCalendar.cjs.map} +1 -1
  81. package/dist/private/createCalendar.js +64 -0
  82. package/dist/{createCalendar.module.js.map → private/createCalendar.js.map} +1 -1
  83. package/dist/private/createCalendar.mjs +64 -0
  84. package/dist/private/createCalendar.mjs.map +1 -0
  85. package/dist/{manipulation.main.js → private/manipulation.cjs} +106 -109
  86. package/dist/private/manipulation.cjs.map +1 -0
  87. package/dist/{manipulation.mjs → private/manipulation.js} +88 -88
  88. package/dist/{manipulation.module.js.map → private/manipulation.js.map} +1 -1
  89. package/dist/{manipulation.module.js → private/manipulation.mjs} +93 -96
  90. package/dist/private/manipulation.mjs.map +1 -0
  91. package/dist/private/queries.cjs +359 -0
  92. package/dist/private/queries.cjs.map +1 -0
  93. package/dist/private/queries.js +326 -0
  94. package/dist/private/queries.js.map +1 -0
  95. package/dist/private/queries.mjs +324 -0
  96. package/dist/private/queries.mjs.map +1 -0
  97. package/dist/private/string.cjs +181 -0
  98. package/dist/private/string.cjs.map +1 -0
  99. package/dist/{string.mjs → private/string.js} +64 -64
  100. package/dist/{string.module.js.map → private/string.js.map} +1 -1
  101. package/dist/private/string.mjs +166 -0
  102. package/dist/private/string.mjs.map +1 -0
  103. package/dist/{utils.main.js → private/utils.cjs} +3 -3
  104. package/dist/{utils.main.js.map → private/utils.cjs.map} +1 -1
  105. package/dist/{utils.module.js → private/utils.js} +3 -3
  106. package/dist/{utils.module.js.map → private/utils.js.map} +1 -1
  107. package/dist/{utils.mjs → private/utils.mjs} +3 -3
  108. package/dist/private/utils.mjs.map +1 -0
  109. package/dist/{weekStartData.main.js → private/weekStartData.cjs} +3 -3
  110. package/dist/{weekStartData.main.js.map → private/weekStartData.cjs.map} +1 -1
  111. package/dist/{weekStartData.module.js → private/weekStartData.js} +3 -3
  112. package/dist/{weekStartData.module.js.map → private/weekStartData.js.map} +1 -1
  113. package/dist/{weekStartData.mjs → private/weekStartData.mjs} +3 -3
  114. package/dist/private/weekStartData.mjs.map +1 -0
  115. package/dist/types/src/CalendarDate.d.ts +177 -0
  116. package/dist/types/src/DateFormatter.d.ts +21 -0
  117. package/dist/types/src/calendars/BuddhistCalendar.d.ts +16 -0
  118. package/dist/types/src/calendars/EthiopicCalendar.d.ts +45 -0
  119. package/dist/types/src/calendars/GregorianCalendar.d.ts +25 -0
  120. package/dist/types/src/calendars/HebrewCalendar.d.ts +21 -0
  121. package/dist/types/src/calendars/IndianCalendar.d.ts +17 -0
  122. package/dist/types/src/calendars/IslamicCalendar.d.ts +48 -0
  123. package/dist/types/src/calendars/JapaneseCalendar.d.ts +21 -0
  124. package/dist/types/src/calendars/PersianCalendar.d.ts +19 -0
  125. package/dist/types/src/calendars/TaiwanCalendar.d.ts +19 -0
  126. package/dist/types/src/conversion.d.ts +42 -0
  127. package/dist/types/src/createCalendar.d.ts +3 -0
  128. package/dist/types/src/index.d.ts +17 -0
  129. package/dist/types/src/manipulation.d.ts +25 -0
  130. package/dist/types/src/queries.d.ts +87 -0
  131. package/dist/types/src/string.d.ts +35 -0
  132. package/dist/types/src/types.d.ts +132 -0
  133. package/dist/types/src/utils.d.ts +4 -0
  134. package/dist/types/src/weekStartData.d.ts +97 -0
  135. package/package.json +26 -11
  136. package/src/CalendarDate.ts +2 -0
  137. package/src/conversion.ts +10 -3
  138. package/src/index.ts +2 -0
  139. package/src/queries.ts +9 -3
  140. package/dist/CalendarDate.main.js.map +0 -1
  141. package/dist/CalendarDate.module.js.map +0 -1
  142. package/dist/DateFormatter.main.js.map +0 -1
  143. package/dist/IslamicCalendar.main.js +0 -168
  144. package/dist/IslamicCalendar.main.js.map +0 -1
  145. package/dist/IslamicCalendar.mjs +0 -161
  146. package/dist/IslamicCalendar.module.js +0 -161
  147. package/dist/TaiwanCalendar.module.js +0 -75
  148. package/dist/conversion.main.js +0 -236
  149. package/dist/conversion.main.js.map +0 -1
  150. package/dist/conversion.mjs +0 -218
  151. package/dist/conversion.module.js +0 -218
  152. package/dist/conversion.module.js.map +0 -1
  153. package/dist/createCalendar.main.js +0 -69
  154. package/dist/createCalendar.mjs +0 -64
  155. package/dist/createCalendar.module.js +0 -64
  156. package/dist/import.mjs +0 -45
  157. package/dist/main.js +0 -112
  158. package/dist/main.js.map +0 -1
  159. package/dist/manipulation.main.js.map +0 -1
  160. package/dist/module.js +0 -45
  161. package/dist/module.js.map +0 -1
  162. package/dist/queries.main.js +0 -354
  163. package/dist/queries.main.js.map +0 -1
  164. package/dist/queries.mjs +0 -320
  165. package/dist/queries.module.js +0 -320
  166. package/dist/queries.module.js.map +0 -1
  167. package/dist/string.main.js +0 -190
  168. package/dist/string.main.js.map +0 -1
  169. package/dist/string.module.js +0 -175
  170. package/dist/types.d.ts +0 -668
  171. package/dist/types.d.ts.map +0 -1
@@ -1,218 +0,0 @@
1
- import {CalendarDate as $35ea8db9cb2ccb90$export$99faa760c7908e4f, CalendarDateTime as $35ea8db9cb2ccb90$export$ca871e8dbb80966f, Time as $35ea8db9cb2ccb90$export$680ea196effce5f, ZonedDateTime as $35ea8db9cb2ccb90$export$d3b7288e7994edea} from "./CalendarDate.module.js";
2
- import {constrain as $735220c2d4774dd3$export$c4e2ecac49351ef2} from "./manipulation.module.js";
3
- import {getExtendedYear as $3b62074eb05584b2$export$c36e0ecb2d4fa69d, GregorianCalendar as $3b62074eb05584b2$export$80ee6245ec4f29ec} from "./GregorianCalendar.module.js";
4
- import {getLocalTimeZone as $14e0f24ef4ac5c92$export$aa8b41735afcabd2, isEqualCalendar as $14e0f24ef4ac5c92$export$dbc69fd56b53d5e} from "./queries.module.js";
5
-
6
- /*
7
- * Copyright 2020 Adobe. All rights reserved.
8
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
9
- * you may not use this file except in compliance with the License. You may obtain a copy
10
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
11
- *
12
- * Unless required by applicable law or agreed to in writing, software distributed under
13
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
14
- * OF ANY KIND, either express or implied. See the License for the specific language
15
- * governing permissions and limitations under the License.
16
- */ // Portions of the code in this file are based on code from the TC39 Temporal proposal.
17
- // Original licensing can be found in the NOTICE file in the root directory of this source tree.
18
-
19
-
20
-
21
-
22
- function $11d87f3f76e88657$export$bd4fb2bc8bb06fb(date) {
23
- date = $11d87f3f76e88657$export$b4a036af3fc0b032(date, new (0, $3b62074eb05584b2$export$80ee6245ec4f29ec)());
24
- let year = (0, $3b62074eb05584b2$export$c36e0ecb2d4fa69d)(date.era, date.year);
25
- return $11d87f3f76e88657$var$epochFromParts(year, date.month, date.day, date.hour, date.minute, date.second, date.millisecond);
26
- }
27
- function $11d87f3f76e88657$var$epochFromParts(year, month, day, hour, minute, second, millisecond) {
28
- // Note: Date.UTC() interprets one and two-digit years as being in the
29
- // 20th century, so don't use it
30
- let date = new Date();
31
- date.setUTCHours(hour, minute, second, millisecond);
32
- date.setUTCFullYear(year, month - 1, day);
33
- return date.getTime();
34
- }
35
- function $11d87f3f76e88657$export$59c99f3515d3493f(ms, timeZone) {
36
- // Fast path for UTC.
37
- if (timeZone === 'UTC') return 0;
38
- // Fast path: for local timezone after 1970, use native Date.
39
- if (ms > 0 && timeZone === (0, $14e0f24ef4ac5c92$export$aa8b41735afcabd2)()) return new Date(ms).getTimezoneOffset() * -60000;
40
- let { year: year, month: month, day: day, hour: hour, minute: minute, second: second } = $11d87f3f76e88657$var$getTimeZoneParts(ms, timeZone);
41
- let utc = $11d87f3f76e88657$var$epochFromParts(year, month, day, hour, minute, second, 0);
42
- return utc - Math.floor(ms / 1000) * 1000;
43
- }
44
- const $11d87f3f76e88657$var$formattersByTimeZone = new Map();
45
- function $11d87f3f76e88657$var$getTimeZoneParts(ms, timeZone) {
46
- let formatter = $11d87f3f76e88657$var$formattersByTimeZone.get(timeZone);
47
- if (!formatter) {
48
- formatter = new Intl.DateTimeFormat('en-US', {
49
- timeZone: timeZone,
50
- hour12: false,
51
- era: 'short',
52
- year: 'numeric',
53
- month: 'numeric',
54
- day: 'numeric',
55
- hour: 'numeric',
56
- minute: 'numeric',
57
- second: 'numeric'
58
- });
59
- $11d87f3f76e88657$var$formattersByTimeZone.set(timeZone, formatter);
60
- }
61
- let parts = formatter.formatToParts(new Date(ms));
62
- let namedParts = {};
63
- for (let part of parts)if (part.type !== 'literal') namedParts[part.type] = part.value;
64
- return {
65
- // Firefox returns B instead of BC... https://bugzilla.mozilla.org/show_bug.cgi?id=1752253
66
- year: namedParts.era === 'BC' || namedParts.era === 'B' ? -namedParts.year + 1 : +namedParts.year,
67
- month: +namedParts.month,
68
- day: +namedParts.day,
69
- hour: namedParts.hour === '24' ? 0 : +namedParts.hour,
70
- minute: +namedParts.minute,
71
- second: +namedParts.second
72
- };
73
- }
74
- const $11d87f3f76e88657$var$DAYMILLIS = 86400000;
75
- function $11d87f3f76e88657$export$136f38efe7caf549(date, timeZone) {
76
- let ms = $11d87f3f76e88657$export$bd4fb2bc8bb06fb(date);
77
- let earlier = ms - $11d87f3f76e88657$export$59c99f3515d3493f(ms - $11d87f3f76e88657$var$DAYMILLIS, timeZone);
78
- let later = ms - $11d87f3f76e88657$export$59c99f3515d3493f(ms + $11d87f3f76e88657$var$DAYMILLIS, timeZone);
79
- return $11d87f3f76e88657$var$getValidWallTimes(date, timeZone, earlier, later);
80
- }
81
- function $11d87f3f76e88657$var$getValidWallTimes(date, timeZone, earlier, later) {
82
- let found = earlier === later ? [
83
- earlier
84
- ] : [
85
- earlier,
86
- later
87
- ];
88
- return found.filter((absolute)=>$11d87f3f76e88657$var$isValidWallTime(date, timeZone, absolute));
89
- }
90
- function $11d87f3f76e88657$var$isValidWallTime(date, timeZone, absolute) {
91
- let parts = $11d87f3f76e88657$var$getTimeZoneParts(absolute, timeZone);
92
- return date.year === parts.year && date.month === parts.month && date.day === parts.day && date.hour === parts.hour && date.minute === parts.minute && date.second === parts.second;
93
- }
94
- function $11d87f3f76e88657$export$5107c82f94518f5c(date, timeZone, disambiguation = 'compatible') {
95
- let dateTime = $11d87f3f76e88657$export$b21e0b124e224484(date);
96
- // Fast path: if the time zone is UTC, use native Date.
97
- if (timeZone === 'UTC') return $11d87f3f76e88657$export$bd4fb2bc8bb06fb(dateTime);
98
- // Fast path: if the time zone is the local timezone and disambiguation is compatible, use native Date.
99
- if (timeZone === (0, $14e0f24ef4ac5c92$export$aa8b41735afcabd2)() && disambiguation === 'compatible') {
100
- dateTime = $11d87f3f76e88657$export$b4a036af3fc0b032(dateTime, new (0, $3b62074eb05584b2$export$80ee6245ec4f29ec)());
101
- // Don't use Date constructor here because two-digit years are interpreted in the 20th century.
102
- let date = new Date();
103
- let year = (0, $3b62074eb05584b2$export$c36e0ecb2d4fa69d)(dateTime.era, dateTime.year);
104
- date.setFullYear(year, dateTime.month - 1, dateTime.day);
105
- date.setHours(dateTime.hour, dateTime.minute, dateTime.second, dateTime.millisecond);
106
- return date.getTime();
107
- }
108
- let ms = $11d87f3f76e88657$export$bd4fb2bc8bb06fb(dateTime);
109
- let offsetBefore = $11d87f3f76e88657$export$59c99f3515d3493f(ms - $11d87f3f76e88657$var$DAYMILLIS, timeZone);
110
- let offsetAfter = $11d87f3f76e88657$export$59c99f3515d3493f(ms + $11d87f3f76e88657$var$DAYMILLIS, timeZone);
111
- let valid = $11d87f3f76e88657$var$getValidWallTimes(dateTime, timeZone, ms - offsetBefore, ms - offsetAfter);
112
- if (valid.length === 1) return valid[0];
113
- if (valid.length > 1) switch(disambiguation){
114
- // 'compatible' means 'earlier' for "fall back" transitions
115
- case 'compatible':
116
- case 'earlier':
117
- return valid[0];
118
- case 'later':
119
- return valid[valid.length - 1];
120
- case 'reject':
121
- throw new RangeError('Multiple possible absolute times found');
122
- }
123
- switch(disambiguation){
124
- case 'earlier':
125
- return Math.min(ms - offsetBefore, ms - offsetAfter);
126
- // 'compatible' means 'later' for "spring forward" transitions
127
- case 'compatible':
128
- case 'later':
129
- return Math.max(ms - offsetBefore, ms - offsetAfter);
130
- case 'reject':
131
- throw new RangeError('No such absolute time found');
132
- }
133
- }
134
- function $11d87f3f76e88657$export$e67a095c620b86fe(dateTime, timeZone, disambiguation = 'compatible') {
135
- return new Date($11d87f3f76e88657$export$5107c82f94518f5c(dateTime, timeZone, disambiguation));
136
- }
137
- function $11d87f3f76e88657$export$1b96692a1ba042ac(ms, timeZone) {
138
- let offset = $11d87f3f76e88657$export$59c99f3515d3493f(ms, timeZone);
139
- let date = new Date(ms + offset);
140
- let year = date.getUTCFullYear();
141
- let month = date.getUTCMonth() + 1;
142
- let day = date.getUTCDate();
143
- let hour = date.getUTCHours();
144
- let minute = date.getUTCMinutes();
145
- let second = date.getUTCSeconds();
146
- let millisecond = date.getUTCMilliseconds();
147
- return new (0, $35ea8db9cb2ccb90$export$d3b7288e7994edea)(year < 1 ? 'BC' : 'AD', year < 1 ? -year + 1 : year, month, day, timeZone, offset, hour, minute, second, millisecond);
148
- }
149
- function $11d87f3f76e88657$export$e57ff100d91bd4b9(date, timeZone) {
150
- return $11d87f3f76e88657$export$1b96692a1ba042ac(date.getTime(), timeZone);
151
- }
152
- function $11d87f3f76e88657$export$d7f92bcd3596b086(date) {
153
- return $11d87f3f76e88657$export$e57ff100d91bd4b9(date, (0, $14e0f24ef4ac5c92$export$aa8b41735afcabd2)());
154
- }
155
- function $11d87f3f76e88657$export$93522d1a439f3617(dateTime) {
156
- return new (0, $35ea8db9cb2ccb90$export$99faa760c7908e4f)(dateTime.calendar, dateTime.era, dateTime.year, dateTime.month, dateTime.day);
157
- }
158
- function $11d87f3f76e88657$export$6f4d78149f3f53ac(date) {
159
- return {
160
- era: date.era,
161
- year: date.year,
162
- month: date.month,
163
- day: date.day
164
- };
165
- }
166
- function $11d87f3f76e88657$export$4d0393e732857be5(date) {
167
- return {
168
- hour: date.hour,
169
- minute: date.minute,
170
- second: date.second,
171
- millisecond: date.millisecond
172
- };
173
- }
174
- function $11d87f3f76e88657$export$b21e0b124e224484(date, time) {
175
- let hour = 0, minute = 0, second = 0, millisecond = 0;
176
- if ('timeZone' in date) ({ hour: hour, minute: minute, second: second, millisecond: millisecond } = date);
177
- else if ('hour' in date && !time) return date;
178
- if (time) ({ hour: hour, minute: minute, second: second, millisecond: millisecond } = time);
179
- return new (0, $35ea8db9cb2ccb90$export$ca871e8dbb80966f)(date.calendar, date.era, date.year, date.month, date.day, hour, minute, second, millisecond);
180
- }
181
- function $11d87f3f76e88657$export$d33f79e3ffc3dc83(dateTime) {
182
- return new (0, $35ea8db9cb2ccb90$export$680ea196effce5f)(dateTime.hour, dateTime.minute, dateTime.second, dateTime.millisecond);
183
- }
184
- function $11d87f3f76e88657$export$b4a036af3fc0b032(date, calendar) {
185
- if ((0, $14e0f24ef4ac5c92$export$dbc69fd56b53d5e)(date.calendar, calendar)) return date;
186
- let calendarDate = calendar.fromJulianDay(date.calendar.toJulianDay(date));
187
- let copy = date.copy();
188
- copy.calendar = calendar;
189
- copy.era = calendarDate.era;
190
- copy.year = calendarDate.year;
191
- copy.month = calendarDate.month;
192
- copy.day = calendarDate.day;
193
- (0, $735220c2d4774dd3$export$c4e2ecac49351ef2)(copy);
194
- return copy;
195
- }
196
- function $11d87f3f76e88657$export$84c95a83c799e074(date, timeZone, disambiguation) {
197
- if (date instanceof (0, $35ea8db9cb2ccb90$export$d3b7288e7994edea)) {
198
- if (date.timeZone === timeZone) return date;
199
- return $11d87f3f76e88657$export$538b00033cc11c75(date, timeZone);
200
- }
201
- let ms = $11d87f3f76e88657$export$5107c82f94518f5c(date, timeZone, disambiguation);
202
- return $11d87f3f76e88657$export$1b96692a1ba042ac(ms, timeZone);
203
- }
204
- function $11d87f3f76e88657$export$83aac07b4c37b25(date) {
205
- let ms = $11d87f3f76e88657$export$bd4fb2bc8bb06fb(date) - date.offset;
206
- return new Date(ms);
207
- }
208
- function $11d87f3f76e88657$export$538b00033cc11c75(date, timeZone) {
209
- let ms = $11d87f3f76e88657$export$bd4fb2bc8bb06fb(date) - date.offset;
210
- return $11d87f3f76e88657$export$b4a036af3fc0b032($11d87f3f76e88657$export$1b96692a1ba042ac(ms, timeZone), date.calendar);
211
- }
212
- function $11d87f3f76e88657$export$d9b67bc93c097491(date) {
213
- return $11d87f3f76e88657$export$538b00033cc11c75(date, (0, $14e0f24ef4ac5c92$export$aa8b41735afcabd2)());
214
- }
215
-
216
-
217
- export {$11d87f3f76e88657$export$bd4fb2bc8bb06fb as epochFromDate, $11d87f3f76e88657$export$b4a036af3fc0b032 as toCalendar, $11d87f3f76e88657$export$59c99f3515d3493f as getTimeZoneOffset, $11d87f3f76e88657$export$136f38efe7caf549 as possibleAbsolutes, $11d87f3f76e88657$export$5107c82f94518f5c as toAbsolute, $11d87f3f76e88657$export$b21e0b124e224484 as toCalendarDateTime, $11d87f3f76e88657$export$e67a095c620b86fe as toDate, $11d87f3f76e88657$export$1b96692a1ba042ac as fromAbsolute, $11d87f3f76e88657$export$e57ff100d91bd4b9 as fromDate, $11d87f3f76e88657$export$d7f92bcd3596b086 as fromDateToLocal, $11d87f3f76e88657$export$93522d1a439f3617 as toCalendarDate, $11d87f3f76e88657$export$6f4d78149f3f53ac as toDateFields, $11d87f3f76e88657$export$4d0393e732857be5 as toTimeFields, $11d87f3f76e88657$export$d33f79e3ffc3dc83 as toTime, $11d87f3f76e88657$export$84c95a83c799e074 as toZoned, $11d87f3f76e88657$export$538b00033cc11c75 as toTimeZone, $11d87f3f76e88657$export$83aac07b4c37b25 as zonedToDate, $11d87f3f76e88657$export$d9b67bc93c097491 as toLocalTimeZone};
218
- //# sourceMappingURL=conversion.module.js.map
@@ -1 +0,0 @@
1
- {"mappings":";;;;;AAAA;;;;;;;;;;CAUC,GAED,uFAAuF;AACvF,gGAAgG;;;;;AASzF,SAAS,yCAAc,IAAiB;IAC7C,OAAO,0CAAW,MAAM,IAAI,CAAA,GAAA,yCAAgB;IAC5C,IA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,IAAI;AAC1B;AAEO,SAAS,yCAAY,IAAmB;IAC7C,IAAI,KAAK,yCAAc,QAAQ,KAAK,MAAM;IAC1C,OAAO,IAAI,KAAK;AAClB;AAGO,SAAS,0CAAW,IAAmB,EAAE,QAAgB;IAC9D,IAAI,KAAK,yCAAc,QAAQ,KAAK,MAAM;IAC1C,OAAO,0CAAW,0CAAa,IAAI,WAAW,KAAK,QAAQ;AAC7D;AAGO,SAAS,0CAAgB,IAAmB;IACjD,OAAO,0CAAW,MAAM,CAAA,GAAA,yCAAe;AACzC","sources":["packages/@internationalized/date/src/conversion.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n// Portions of the code in this file are based on code from the TC39 Temporal proposal.\n// Original licensing can be found in the NOTICE file in the root directory of this source tree.\n\nimport {AnyCalendarDate, AnyDateTime, AnyTime, Calendar, DateFields, Disambiguation, TimeFields} from './types';\nimport {CalendarDate, CalendarDateTime, Time, ZonedDateTime} from './CalendarDate';\nimport {constrain} from './manipulation';\nimport {getExtendedYear, GregorianCalendar} from './calendars/GregorianCalendar';\nimport {getLocalTimeZone, isEqualCalendar} from './queries';\nimport {Mutable} from './utils';\n\nexport function epochFromDate(date: AnyDateTime): number {\n date = toCalendar(date, new GregorianCalendar());\n let year = getExtendedYear(date.era, date.year);\n return epochFromParts(year, date.month, date.day, date.hour, date.minute, date.second, date.millisecond);\n}\n\nfunction epochFromParts(year: number, month: number, day: number, hour: number, minute: number, second: number, millisecond: number): number {\n // Note: Date.UTC() interprets one and two-digit years as being in the\n // 20th century, so don't use it\n let date = new Date();\n date.setUTCHours(hour, minute, second, millisecond);\n date.setUTCFullYear(year, month - 1, day);\n return date.getTime();\n}\n\nexport function getTimeZoneOffset(ms: number, timeZone: string): number {\n // Fast path for UTC.\n if (timeZone === 'UTC') {\n return 0;\n }\n\n // Fast path: for local timezone after 1970, use native Date.\n if (ms > 0 && timeZone === getLocalTimeZone()) {\n return new Date(ms).getTimezoneOffset() * -60 * 1000;\n }\n\n let {year, month, day, hour, minute, second} = getTimeZoneParts(ms, timeZone);\n let utc = epochFromParts(year, month, day, hour, minute, second, 0);\n return utc - Math.floor(ms / 1000) * 1000;\n}\n\nconst formattersByTimeZone = new Map<string, Intl.DateTimeFormat>();\n\nfunction getTimeZoneParts(ms: number, timeZone: string) {\n let formatter = formattersByTimeZone.get(timeZone);\n if (!formatter) {\n formatter = new Intl.DateTimeFormat('en-US', {\n timeZone,\n hour12: false,\n era: 'short',\n year: 'numeric',\n month: 'numeric',\n day: 'numeric',\n hour: 'numeric',\n minute: 'numeric',\n second: 'numeric'\n });\n\n formattersByTimeZone.set(timeZone, formatter);\n }\n\n let parts = formatter.formatToParts(new Date(ms));\n let namedParts: {[name: string]: string} = {};\n for (let part of parts) {\n if (part.type !== 'literal') {\n namedParts[part.type] = part.value;\n }\n }\n\n\n return {\n // Firefox returns B instead of BC... https://bugzilla.mozilla.org/show_bug.cgi?id=1752253\n year: namedParts.era === 'BC' || namedParts.era === 'B' ? -namedParts.year + 1 : +namedParts.year,\n month: +namedParts.month,\n day: +namedParts.day,\n hour: namedParts.hour === '24' ? 0 : +namedParts.hour, // bugs.chromium.org/p/chromium/issues/detail?id=1045791\n minute: +namedParts.minute,\n second: +namedParts.second\n };\n}\n\nconst DAYMILLIS = 86400000;\n\nexport function possibleAbsolutes(date: CalendarDateTime, timeZone: string): number[] {\n let ms = epochFromDate(date);\n let earlier = ms - getTimeZoneOffset(ms - DAYMILLIS, timeZone);\n let later = ms - getTimeZoneOffset(ms + DAYMILLIS, timeZone);\n return getValidWallTimes(date, timeZone, earlier, later);\n}\n\nfunction getValidWallTimes(date: CalendarDateTime, timeZone: string, earlier: number, later: number): number[] {\n let found = earlier === later ? [earlier] : [earlier, later];\n return found.filter(absolute => isValidWallTime(date, timeZone, absolute));\n}\n\nfunction isValidWallTime(date: CalendarDateTime, timeZone: string, absolute: number) {\n let parts = getTimeZoneParts(absolute, timeZone);\n return date.year === parts.year\n && date.month === parts.month\n && date.day === parts.day\n && date.hour === parts.hour\n && date.minute === parts.minute\n && date.second === parts.second;\n}\n\nexport function toAbsolute(date: CalendarDate | CalendarDateTime, timeZone: string, disambiguation: Disambiguation = 'compatible'): number {\n let dateTime = toCalendarDateTime(date);\n\n // Fast path: if the time zone is UTC, use native Date.\n if (timeZone === 'UTC') {\n return epochFromDate(dateTime);\n }\n\n // Fast path: if the time zone is the local timezone and disambiguation is compatible, use native Date.\n if (timeZone === getLocalTimeZone() && disambiguation === 'compatible') {\n dateTime = toCalendar(dateTime, new GregorianCalendar());\n\n // Don't use Date constructor here because two-digit years are interpreted in the 20th century.\n let date = new Date();\n let year = getExtendedYear(dateTime.era, dateTime.year);\n date.setFullYear(year, dateTime.month - 1, dateTime.day);\n date.setHours(dateTime.hour, dateTime.minute, dateTime.second, dateTime.millisecond);\n return date.getTime();\n }\n\n let ms = epochFromDate(dateTime);\n let offsetBefore = getTimeZoneOffset(ms - DAYMILLIS, timeZone);\n let offsetAfter = getTimeZoneOffset(ms + DAYMILLIS, timeZone);\n let valid = getValidWallTimes(dateTime, timeZone, ms - offsetBefore, ms - offsetAfter);\n\n if (valid.length === 1) {\n return valid[0];\n }\n\n if (valid.length > 1) {\n switch (disambiguation) {\n // 'compatible' means 'earlier' for \"fall back\" transitions\n case 'compatible':\n case 'earlier':\n return valid[0];\n case 'later':\n return valid[valid.length - 1];\n case 'reject':\n throw new RangeError('Multiple possible absolute times found');\n }\n }\n\n switch (disambiguation) {\n case 'earlier':\n return Math.min(ms - offsetBefore, ms - offsetAfter);\n // 'compatible' means 'later' for \"spring forward\" transitions\n case 'compatible':\n case 'later':\n return Math.max(ms - offsetBefore, ms - offsetAfter);\n case 'reject':\n throw new RangeError('No such absolute time found');\n }\n}\n\nexport function toDate(dateTime: CalendarDate | CalendarDateTime, timeZone: string, disambiguation: Disambiguation = 'compatible'): Date {\n return new Date(toAbsolute(dateTime, timeZone, disambiguation));\n}\n\n/**\n * Takes a Unix epoch (milliseconds since 1970) and converts it to the provided time zone.\n */\nexport function fromAbsolute(ms: number, timeZone: string): ZonedDateTime {\n let offset = getTimeZoneOffset(ms, timeZone);\n let date = new Date(ms + offset);\n let year = date.getUTCFullYear();\n let month = date.getUTCMonth() + 1;\n let day = date.getUTCDate();\n let hour = date.getUTCHours();\n let minute = date.getUTCMinutes();\n let second = date.getUTCSeconds();\n let millisecond = date.getUTCMilliseconds();\n\n return new ZonedDateTime(year < 1 ? 'BC' : 'AD', year < 1 ? -year + 1 : year, month, day, timeZone, offset, hour, minute, second, millisecond);\n}\n\n/**\n * Takes a `Date` object and converts it to the provided time zone.\n */\nexport function fromDate(date: Date, timeZone: string): ZonedDateTime {\n return fromAbsolute(date.getTime(), timeZone);\n}\n\nexport function fromDateToLocal(date: Date): ZonedDateTime {\n return fromDate(date, getLocalTimeZone());\n}\n\n/** Converts a value with date components such as a `CalendarDateTime` or `ZonedDateTime` into a `CalendarDate`. */\nexport function toCalendarDate(dateTime: AnyCalendarDate): CalendarDate {\n return new CalendarDate(dateTime.calendar, dateTime.era, dateTime.year, dateTime.month, dateTime.day);\n}\n\nexport function toDateFields(date: AnyCalendarDate): DateFields {\n return {\n era: date.era,\n year: date.year,\n month: date.month,\n day: date.day\n };\n}\n\nexport function toTimeFields(date: AnyTime): TimeFields {\n return {\n hour: date.hour,\n minute: date.minute,\n second: date.second,\n millisecond: date.millisecond\n };\n}\n\n/**\n * Converts a date value to a `CalendarDateTime`. An optional `Time` value can be passed to set the time\n * of the resulting value, otherwise it will default to midnight.\n */\nexport function toCalendarDateTime(date: CalendarDate | CalendarDateTime | ZonedDateTime, time?: AnyTime): CalendarDateTime {\n let hour = 0, minute = 0, second = 0, millisecond = 0;\n if ('timeZone' in date) {\n ({hour, minute, second, millisecond} = date);\n } else if ('hour' in date && !time) {\n return date;\n }\n\n if (time) {\n ({hour, minute, second, millisecond} = time);\n }\n\n return new CalendarDateTime(\n date.calendar,\n date.era,\n date.year,\n date.month,\n date.day,\n hour,\n minute,\n second,\n millisecond\n );\n}\n\n/** Extracts the time components from a value containing a date and time. */\nexport function toTime(dateTime: CalendarDateTime | ZonedDateTime): Time {\n return new Time(dateTime.hour, dateTime.minute, dateTime.second, dateTime.millisecond);\n}\n\n/** Converts a date from one calendar system to another. */\nexport function toCalendar<T extends AnyCalendarDate>(date: T, calendar: Calendar): T {\n if (isEqualCalendar(date.calendar, calendar)) {\n return date;\n }\n\n let calendarDate = calendar.fromJulianDay(date.calendar.toJulianDay(date));\n let copy: Mutable<T> = date.copy();\n copy.calendar = calendar;\n copy.era = calendarDate.era;\n copy.year = calendarDate.year;\n copy.month = calendarDate.month;\n copy.day = calendarDate.day;\n constrain(copy);\n return copy;\n}\n\n/**\n * Converts a date value to a `ZonedDateTime` in the provided time zone. The `disambiguation` option can be set\n * to control how values that fall on daylight saving time changes are interpreted.\n */\nexport function toZoned(date: CalendarDate | CalendarDateTime | ZonedDateTime, timeZone: string, disambiguation?: Disambiguation): ZonedDateTime {\n if (date instanceof ZonedDateTime) {\n if (date.timeZone === timeZone) {\n return date;\n }\n\n return toTimeZone(date, timeZone);\n }\n\n let ms = toAbsolute(date, timeZone, disambiguation);\n return fromAbsolute(ms, timeZone);\n}\n\nexport function zonedToDate(date: ZonedDateTime): Date {\n let ms = epochFromDate(date) - date.offset;\n return new Date(ms);\n}\n\n/** Converts a `ZonedDateTime` from one time zone to another. */\nexport function toTimeZone(date: ZonedDateTime, timeZone: string): ZonedDateTime {\n let ms = epochFromDate(date) - date.offset;\n return toCalendar(fromAbsolute(ms, timeZone), date.calendar);\n}\n\n/** Converts the given `ZonedDateTime` into the user's local time zone. */\nexport function toLocalTimeZone(date: ZonedDateTime): ZonedDateTime {\n return toTimeZone(date, getLocalTimeZone());\n}\n"],"names":[],"version":3,"file":"conversion.module.js.map"}
@@ -1,69 +0,0 @@
1
- var $561c4ef058278b74$exports = require("./BuddhistCalendar.main.js");
2
- var $4db04d1051af0f2f$exports = require("./EthiopicCalendar.main.js");
3
- var $af14c9812fdceb33$exports = require("./GregorianCalendar.main.js");
4
- var $0f5324ee3bdd9396$exports = require("./HebrewCalendar.main.js");
5
- var $5f1dfa5c67609fe6$exports = require("./IndianCalendar.main.js");
6
- var $ecb2c4cc8c9aae25$exports = require("./IslamicCalendar.main.js");
7
- var $b0ac0602ef646b2c$exports = require("./JapaneseCalendar.main.js");
8
- var $3c060181fc7249ae$exports = require("./PersianCalendar.main.js");
9
- var $9cc5d3577ec40243$exports = require("./TaiwanCalendar.main.js");
10
-
11
-
12
- function $parcel$export(e, n, v, s) {
13
- Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
14
- }
15
-
16
- $parcel$export(module.exports, "createCalendar", () => $4922c0a5a69da0ba$export$dd0bbc9b26defe37);
17
- /*
18
- * Copyright 2020 Adobe. All rights reserved.
19
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
20
- * you may not use this file except in compliance with the License. You may obtain a copy
21
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
22
- *
23
- * Unless required by applicable law or agreed to in writing, software distributed under
24
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
25
- * OF ANY KIND, either express or implied. See the License for the specific language
26
- * governing permissions and limitations under the License.
27
- */
28
-
29
-
30
-
31
-
32
-
33
-
34
-
35
-
36
- function $4922c0a5a69da0ba$export$dd0bbc9b26defe37(name) {
37
- switch(name){
38
- case 'buddhist':
39
- return new (0, $561c4ef058278b74$exports.BuddhistCalendar)();
40
- case 'ethiopic':
41
- return new (0, $4db04d1051af0f2f$exports.EthiopicCalendar)();
42
- case 'ethioaa':
43
- return new (0, $4db04d1051af0f2f$exports.EthiopicAmeteAlemCalendar)();
44
- case 'coptic':
45
- return new (0, $4db04d1051af0f2f$exports.CopticCalendar)();
46
- case 'hebrew':
47
- return new (0, $0f5324ee3bdd9396$exports.HebrewCalendar)();
48
- case 'indian':
49
- return new (0, $5f1dfa5c67609fe6$exports.IndianCalendar)();
50
- case 'islamic-civil':
51
- return new (0, $ecb2c4cc8c9aae25$exports.IslamicCivilCalendar)();
52
- case 'islamic-tbla':
53
- return new (0, $ecb2c4cc8c9aae25$exports.IslamicTabularCalendar)();
54
- case 'islamic-umalqura':
55
- return new (0, $ecb2c4cc8c9aae25$exports.IslamicUmalquraCalendar)();
56
- case 'japanese':
57
- return new (0, $b0ac0602ef646b2c$exports.JapaneseCalendar)();
58
- case 'persian':
59
- return new (0, $3c060181fc7249ae$exports.PersianCalendar)();
60
- case 'roc':
61
- return new (0, $9cc5d3577ec40243$exports.TaiwanCalendar)();
62
- case 'gregory':
63
- default:
64
- return new (0, $af14c9812fdceb33$exports.GregorianCalendar)();
65
- }
66
- }
67
-
68
-
69
- //# sourceMappingURL=createCalendar.main.js.map
@@ -1,64 +0,0 @@
1
- import {BuddhistCalendar as $8d73d47422ca7302$export$42d20a78301dee44} from "./BuddhistCalendar.mjs";
2
- import {CopticCalendar as $b956b2d7a6cf451f$export$fe6243cbe1a4b7c1, EthiopicAmeteAlemCalendar as $b956b2d7a6cf451f$export$d72e0c37005a4914, EthiopicCalendar as $b956b2d7a6cf451f$export$26ba6eab5e20cd7d} from "./EthiopicCalendar.mjs";
3
- import {GregorianCalendar as $3b62074eb05584b2$export$80ee6245ec4f29ec} from "./GregorianCalendar.mjs";
4
- import {HebrewCalendar as $7c5f6fbf42389787$export$ca405048b8fb5af} from "./HebrewCalendar.mjs";
5
- import {IndianCalendar as $82c358003bdda0a8$export$39f31c639fa15726} from "./IndianCalendar.mjs";
6
- import {IslamicCivilCalendar as $f2f3e0e3a817edbd$export$2066795aadd37bfc, IslamicTabularCalendar as $f2f3e0e3a817edbd$export$37f0887f2f9d22f7, IslamicUmalquraCalendar as $f2f3e0e3a817edbd$export$5baab4758c231076} from "./IslamicCalendar.mjs";
7
- import {JapaneseCalendar as $62225008020f0a13$export$b746ab2b60cdffbf} from "./JapaneseCalendar.mjs";
8
- import {PersianCalendar as $f3ed2e4472ae7e25$export$37fccdbfd14c5939} from "./PersianCalendar.mjs";
9
- import {TaiwanCalendar as $5f31bd6f0c8940b2$export$65e01080afcb0799} from "./TaiwanCalendar.mjs";
10
-
11
- /*
12
- * Copyright 2020 Adobe. All rights reserved.
13
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
14
- * you may not use this file except in compliance with the License. You may obtain a copy
15
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
16
- *
17
- * Unless required by applicable law or agreed to in writing, software distributed under
18
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
19
- * OF ANY KIND, either express or implied. See the License for the specific language
20
- * governing permissions and limitations under the License.
21
- */
22
-
23
-
24
-
25
-
26
-
27
-
28
-
29
-
30
- function $64244302c3013299$export$dd0bbc9b26defe37(name) {
31
- switch(name){
32
- case 'buddhist':
33
- return new (0, $8d73d47422ca7302$export$42d20a78301dee44)();
34
- case 'ethiopic':
35
- return new (0, $b956b2d7a6cf451f$export$26ba6eab5e20cd7d)();
36
- case 'ethioaa':
37
- return new (0, $b956b2d7a6cf451f$export$d72e0c37005a4914)();
38
- case 'coptic':
39
- return new (0, $b956b2d7a6cf451f$export$fe6243cbe1a4b7c1)();
40
- case 'hebrew':
41
- return new (0, $7c5f6fbf42389787$export$ca405048b8fb5af)();
42
- case 'indian':
43
- return new (0, $82c358003bdda0a8$export$39f31c639fa15726)();
44
- case 'islamic-civil':
45
- return new (0, $f2f3e0e3a817edbd$export$2066795aadd37bfc)();
46
- case 'islamic-tbla':
47
- return new (0, $f2f3e0e3a817edbd$export$37f0887f2f9d22f7)();
48
- case 'islamic-umalqura':
49
- return new (0, $f2f3e0e3a817edbd$export$5baab4758c231076)();
50
- case 'japanese':
51
- return new (0, $62225008020f0a13$export$b746ab2b60cdffbf)();
52
- case 'persian':
53
- return new (0, $f3ed2e4472ae7e25$export$37fccdbfd14c5939)();
54
- case 'roc':
55
- return new (0, $5f31bd6f0c8940b2$export$65e01080afcb0799)();
56
- case 'gregory':
57
- default:
58
- return new (0, $3b62074eb05584b2$export$80ee6245ec4f29ec)();
59
- }
60
- }
61
-
62
-
63
- export {$64244302c3013299$export$dd0bbc9b26defe37 as createCalendar};
64
- //# sourceMappingURL=createCalendar.module.js.map
@@ -1,64 +0,0 @@
1
- import {BuddhistCalendar as $8d73d47422ca7302$export$42d20a78301dee44} from "./BuddhistCalendar.module.js";
2
- import {CopticCalendar as $b956b2d7a6cf451f$export$fe6243cbe1a4b7c1, EthiopicAmeteAlemCalendar as $b956b2d7a6cf451f$export$d72e0c37005a4914, EthiopicCalendar as $b956b2d7a6cf451f$export$26ba6eab5e20cd7d} from "./EthiopicCalendar.module.js";
3
- import {GregorianCalendar as $3b62074eb05584b2$export$80ee6245ec4f29ec} from "./GregorianCalendar.module.js";
4
- import {HebrewCalendar as $7c5f6fbf42389787$export$ca405048b8fb5af} from "./HebrewCalendar.module.js";
5
- import {IndianCalendar as $82c358003bdda0a8$export$39f31c639fa15726} from "./IndianCalendar.module.js";
6
- import {IslamicCivilCalendar as $f2f3e0e3a817edbd$export$2066795aadd37bfc, IslamicTabularCalendar as $f2f3e0e3a817edbd$export$37f0887f2f9d22f7, IslamicUmalquraCalendar as $f2f3e0e3a817edbd$export$5baab4758c231076} from "./IslamicCalendar.module.js";
7
- import {JapaneseCalendar as $62225008020f0a13$export$b746ab2b60cdffbf} from "./JapaneseCalendar.module.js";
8
- import {PersianCalendar as $f3ed2e4472ae7e25$export$37fccdbfd14c5939} from "./PersianCalendar.module.js";
9
- import {TaiwanCalendar as $5f31bd6f0c8940b2$export$65e01080afcb0799} from "./TaiwanCalendar.module.js";
10
-
11
- /*
12
- * Copyright 2020 Adobe. All rights reserved.
13
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
14
- * you may not use this file except in compliance with the License. You may obtain a copy
15
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
16
- *
17
- * Unless required by applicable law or agreed to in writing, software distributed under
18
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
19
- * OF ANY KIND, either express or implied. See the License for the specific language
20
- * governing permissions and limitations under the License.
21
- */
22
-
23
-
24
-
25
-
26
-
27
-
28
-
29
-
30
- function $64244302c3013299$export$dd0bbc9b26defe37(name) {
31
- switch(name){
32
- case 'buddhist':
33
- return new (0, $8d73d47422ca7302$export$42d20a78301dee44)();
34
- case 'ethiopic':
35
- return new (0, $b956b2d7a6cf451f$export$26ba6eab5e20cd7d)();
36
- case 'ethioaa':
37
- return new (0, $b956b2d7a6cf451f$export$d72e0c37005a4914)();
38
- case 'coptic':
39
- return new (0, $b956b2d7a6cf451f$export$fe6243cbe1a4b7c1)();
40
- case 'hebrew':
41
- return new (0, $7c5f6fbf42389787$export$ca405048b8fb5af)();
42
- case 'indian':
43
- return new (0, $82c358003bdda0a8$export$39f31c639fa15726)();
44
- case 'islamic-civil':
45
- return new (0, $f2f3e0e3a817edbd$export$2066795aadd37bfc)();
46
- case 'islamic-tbla':
47
- return new (0, $f2f3e0e3a817edbd$export$37f0887f2f9d22f7)();
48
- case 'islamic-umalqura':
49
- return new (0, $f2f3e0e3a817edbd$export$5baab4758c231076)();
50
- case 'japanese':
51
- return new (0, $62225008020f0a13$export$b746ab2b60cdffbf)();
52
- case 'persian':
53
- return new (0, $f3ed2e4472ae7e25$export$37fccdbfd14c5939)();
54
- case 'roc':
55
- return new (0, $5f31bd6f0c8940b2$export$65e01080afcb0799)();
56
- case 'gregory':
57
- default:
58
- return new (0, $3b62074eb05584b2$export$80ee6245ec4f29ec)();
59
- }
60
- }
61
-
62
-
63
- export {$64244302c3013299$export$dd0bbc9b26defe37 as createCalendar};
64
- //# sourceMappingURL=createCalendar.module.js.map
package/dist/import.mjs DELETED
@@ -1,45 +0,0 @@
1
- import {CalendarDate as $35ea8db9cb2ccb90$export$99faa760c7908e4f, CalendarDateTime as $35ea8db9cb2ccb90$export$ca871e8dbb80966f, Time as $35ea8db9cb2ccb90$export$680ea196effce5f, ZonedDateTime as $35ea8db9cb2ccb90$export$d3b7288e7994edea} from "./CalendarDate.mjs";
2
- import {GregorianCalendar as $3b62074eb05584b2$export$80ee6245ec4f29ec} from "./GregorianCalendar.mjs";
3
- import {JapaneseCalendar as $62225008020f0a13$export$b746ab2b60cdffbf} from "./JapaneseCalendar.mjs";
4
- import {BuddhistCalendar as $8d73d47422ca7302$export$42d20a78301dee44} from "./BuddhistCalendar.mjs";
5
- import {TaiwanCalendar as $5f31bd6f0c8940b2$export$65e01080afcb0799} from "./TaiwanCalendar.mjs";
6
- import {PersianCalendar as $f3ed2e4472ae7e25$export$37fccdbfd14c5939} from "./PersianCalendar.mjs";
7
- import {IndianCalendar as $82c358003bdda0a8$export$39f31c639fa15726} from "./IndianCalendar.mjs";
8
- import {IslamicCivilCalendar as $f2f3e0e3a817edbd$export$2066795aadd37bfc, IslamicTabularCalendar as $f2f3e0e3a817edbd$export$37f0887f2f9d22f7, IslamicUmalquraCalendar as $f2f3e0e3a817edbd$export$5baab4758c231076} from "./IslamicCalendar.mjs";
9
- import {HebrewCalendar as $7c5f6fbf42389787$export$ca405048b8fb5af} from "./HebrewCalendar.mjs";
10
- import {CopticCalendar as $b956b2d7a6cf451f$export$fe6243cbe1a4b7c1, EthiopicAmeteAlemCalendar as $b956b2d7a6cf451f$export$d72e0c37005a4914, EthiopicCalendar as $b956b2d7a6cf451f$export$26ba6eab5e20cd7d} from "./EthiopicCalendar.mjs";
11
- import {createCalendar as $64244302c3013299$export$dd0bbc9b26defe37} from "./createCalendar.mjs";
12
- import {fromAbsolute as $11d87f3f76e88657$export$1b96692a1ba042ac, fromDate as $11d87f3f76e88657$export$e57ff100d91bd4b9, toCalendar as $11d87f3f76e88657$export$b4a036af3fc0b032, toCalendarDate as $11d87f3f76e88657$export$93522d1a439f3617, toCalendarDateTime as $11d87f3f76e88657$export$b21e0b124e224484, toLocalTimeZone as $11d87f3f76e88657$export$d9b67bc93c097491, toTime as $11d87f3f76e88657$export$d33f79e3ffc3dc83, toTimeZone as $11d87f3f76e88657$export$538b00033cc11c75, toZoned as $11d87f3f76e88657$export$84c95a83c799e074} from "./conversion.mjs";
13
- import {endOfMonth as $14e0f24ef4ac5c92$export$a2258d9c4118825c, endOfWeek as $14e0f24ef4ac5c92$export$ef8b6d9133084f4e, endOfYear as $14e0f24ef4ac5c92$export$8b7aa55c66d5569e, getDayOfWeek as $14e0f24ef4ac5c92$export$2061056d06d7cdf7, getHoursInDay as $14e0f24ef4ac5c92$export$126c91c941de7e, getLocalTimeZone as $14e0f24ef4ac5c92$export$aa8b41735afcabd2, getMinimumDayInMonth as $14e0f24ef4ac5c92$export$b2f4953d301981d5, getMinimumMonthInYear as $14e0f24ef4ac5c92$export$5412ac11713b72ad, getWeeksInMonth as $14e0f24ef4ac5c92$export$ccc1b2479e7dd654, isEqualCalendar as $14e0f24ef4ac5c92$export$dbc69fd56b53d5e, isEqualDay as $14e0f24ef4ac5c92$export$91b62ebf2ba703ee, isEqualMonth as $14e0f24ef4ac5c92$export$5a8da0c44a3afdf2, isEqualYear as $14e0f24ef4ac5c92$export$ea840f5a6dda8147, isSameDay as $14e0f24ef4ac5c92$export$ea39ec197993aef0, isSameMonth as $14e0f24ef4ac5c92$export$a18c89cbd24170ff, isSameYear as $14e0f24ef4ac5c92$export$5841f9eb9773f25f, isToday as $14e0f24ef4ac5c92$export$629b0a497aa65267, isWeekday as $14e0f24ef4ac5c92$export$ee9d87258e1d19ed, isWeekend as $14e0f24ef4ac5c92$export$618d60ea299da42, maxDate as $14e0f24ef4ac5c92$export$a75f2bff57811055, minDate as $14e0f24ef4ac5c92$export$5c333a116e949cdd, now as $14e0f24ef4ac5c92$export$461939dd4422153, resetLocalTimeZone as $14e0f24ef4ac5c92$export$55753838ffe79333, setLocalTimeZone as $14e0f24ef4ac5c92$export$61a9d83ceb59a3dd, startOfMonth as $14e0f24ef4ac5c92$export$a5a3b454ada2268e, startOfWeek as $14e0f24ef4ac5c92$export$42c81a444fbfb5d4, startOfYear as $14e0f24ef4ac5c92$export$f91e89d3d0406102, today as $14e0f24ef4ac5c92$export$d0bdf45af03a6ea3} from "./queries.mjs";
14
- import {parseAbsolute as $fae977aafc393c5c$export$5adfdab05168c219, parseAbsoluteToLocal as $fae977aafc393c5c$export$8e384432362ed0f0, parseDate as $fae977aafc393c5c$export$6b862160d295c8e, parseDateTime as $fae977aafc393c5c$export$588937bcd60ade55, parseDuration as $fae977aafc393c5c$export$ecae829bb3747ea6, parseTime as $fae977aafc393c5c$export$c9698ec7f05a07e1, parseZonedDateTime as $fae977aafc393c5c$export$fd7893f06e92a6a4} from "./string.mjs";
15
- import {DateFormatter as $fb18d541ea1ad717$export$ad991b66133851cf} from "./DateFormatter.mjs";
16
-
17
- /*
18
- * Copyright 2020 Adobe. All rights reserved.
19
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
20
- * you may not use this file except in compliance with the License. You may obtain a copy
21
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
22
- *
23
- * Unless required by applicable law or agreed to in writing, software distributed under
24
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
25
- * OF ANY KIND, either express or implied. See the License for the specific language
26
- * governing permissions and limitations under the License.
27
- */
28
-
29
-
30
-
31
-
32
-
33
-
34
-
35
-
36
-
37
-
38
-
39
-
40
-
41
-
42
-
43
-
44
- export {$35ea8db9cb2ccb90$export$99faa760c7908e4f as CalendarDate, $35ea8db9cb2ccb90$export$ca871e8dbb80966f as CalendarDateTime, $35ea8db9cb2ccb90$export$680ea196effce5f as Time, $35ea8db9cb2ccb90$export$d3b7288e7994edea as ZonedDateTime, $3b62074eb05584b2$export$80ee6245ec4f29ec as GregorianCalendar, $62225008020f0a13$export$b746ab2b60cdffbf as JapaneseCalendar, $8d73d47422ca7302$export$42d20a78301dee44 as BuddhistCalendar, $5f31bd6f0c8940b2$export$65e01080afcb0799 as TaiwanCalendar, $f3ed2e4472ae7e25$export$37fccdbfd14c5939 as PersianCalendar, $82c358003bdda0a8$export$39f31c639fa15726 as IndianCalendar, $f2f3e0e3a817edbd$export$2066795aadd37bfc as IslamicCivilCalendar, $f2f3e0e3a817edbd$export$37f0887f2f9d22f7 as IslamicTabularCalendar, $f2f3e0e3a817edbd$export$5baab4758c231076 as IslamicUmalquraCalendar, $7c5f6fbf42389787$export$ca405048b8fb5af as HebrewCalendar, $b956b2d7a6cf451f$export$26ba6eab5e20cd7d as EthiopicCalendar, $b956b2d7a6cf451f$export$d72e0c37005a4914 as EthiopicAmeteAlemCalendar, $b956b2d7a6cf451f$export$fe6243cbe1a4b7c1 as CopticCalendar, $64244302c3013299$export$dd0bbc9b26defe37 as createCalendar, $11d87f3f76e88657$export$93522d1a439f3617 as toCalendarDate, $11d87f3f76e88657$export$b21e0b124e224484 as toCalendarDateTime, $11d87f3f76e88657$export$d33f79e3ffc3dc83 as toTime, $11d87f3f76e88657$export$b4a036af3fc0b032 as toCalendar, $11d87f3f76e88657$export$84c95a83c799e074 as toZoned, $11d87f3f76e88657$export$538b00033cc11c75 as toTimeZone, $11d87f3f76e88657$export$d9b67bc93c097491 as toLocalTimeZone, $11d87f3f76e88657$export$e57ff100d91bd4b9 as fromDate, $11d87f3f76e88657$export$1b96692a1ba042ac as fromAbsolute, $14e0f24ef4ac5c92$export$ea39ec197993aef0 as isSameDay, $14e0f24ef4ac5c92$export$a18c89cbd24170ff as isSameMonth, $14e0f24ef4ac5c92$export$5841f9eb9773f25f as isSameYear, $14e0f24ef4ac5c92$export$91b62ebf2ba703ee as isEqualDay, $14e0f24ef4ac5c92$export$5a8da0c44a3afdf2 as isEqualMonth, $14e0f24ef4ac5c92$export$ea840f5a6dda8147 as isEqualYear, $14e0f24ef4ac5c92$export$629b0a497aa65267 as isToday, $14e0f24ef4ac5c92$export$2061056d06d7cdf7 as getDayOfWeek, $14e0f24ef4ac5c92$export$461939dd4422153 as now, $14e0f24ef4ac5c92$export$d0bdf45af03a6ea3 as today, $14e0f24ef4ac5c92$export$126c91c941de7e as getHoursInDay, $14e0f24ef4ac5c92$export$aa8b41735afcabd2 as getLocalTimeZone, $14e0f24ef4ac5c92$export$61a9d83ceb59a3dd as setLocalTimeZone, $14e0f24ef4ac5c92$export$55753838ffe79333 as resetLocalTimeZone, $14e0f24ef4ac5c92$export$a5a3b454ada2268e as startOfMonth, $14e0f24ef4ac5c92$export$42c81a444fbfb5d4 as startOfWeek, $14e0f24ef4ac5c92$export$f91e89d3d0406102 as startOfYear, $14e0f24ef4ac5c92$export$a2258d9c4118825c as endOfMonth, $14e0f24ef4ac5c92$export$ef8b6d9133084f4e as endOfWeek, $14e0f24ef4ac5c92$export$8b7aa55c66d5569e as endOfYear, $14e0f24ef4ac5c92$export$5412ac11713b72ad as getMinimumMonthInYear, $14e0f24ef4ac5c92$export$b2f4953d301981d5 as getMinimumDayInMonth, $14e0f24ef4ac5c92$export$ccc1b2479e7dd654 as getWeeksInMonth, $14e0f24ef4ac5c92$export$5c333a116e949cdd as minDate, $14e0f24ef4ac5c92$export$a75f2bff57811055 as maxDate, $14e0f24ef4ac5c92$export$618d60ea299da42 as isWeekend, $14e0f24ef4ac5c92$export$ee9d87258e1d19ed as isWeekday, $14e0f24ef4ac5c92$export$dbc69fd56b53d5e as isEqualCalendar, $fae977aafc393c5c$export$6b862160d295c8e as parseDate, $fae977aafc393c5c$export$588937bcd60ade55 as parseDateTime, $fae977aafc393c5c$export$c9698ec7f05a07e1 as parseTime, $fae977aafc393c5c$export$5adfdab05168c219 as parseAbsolute, $fae977aafc393c5c$export$8e384432362ed0f0 as parseAbsoluteToLocal, $fae977aafc393c5c$export$fd7893f06e92a6a4 as parseZonedDateTime, $fae977aafc393c5c$export$ecae829bb3747ea6 as parseDuration, $fb18d541ea1ad717$export$ad991b66133851cf as DateFormatter};
45
- //# sourceMappingURL=module.js.map
package/dist/main.js DELETED
@@ -1,112 +0,0 @@
1
- var $625ad1e1f4c43bc1$exports = require("./CalendarDate.main.js");
2
- var $af14c9812fdceb33$exports = require("./GregorianCalendar.main.js");
3
- var $b0ac0602ef646b2c$exports = require("./JapaneseCalendar.main.js");
4
- var $561c4ef058278b74$exports = require("./BuddhistCalendar.main.js");
5
- var $9cc5d3577ec40243$exports = require("./TaiwanCalendar.main.js");
6
- var $3c060181fc7249ae$exports = require("./PersianCalendar.main.js");
7
- var $5f1dfa5c67609fe6$exports = require("./IndianCalendar.main.js");
8
- var $ecb2c4cc8c9aae25$exports = require("./IslamicCalendar.main.js");
9
- var $0f5324ee3bdd9396$exports = require("./HebrewCalendar.main.js");
10
- var $4db04d1051af0f2f$exports = require("./EthiopicCalendar.main.js");
11
- var $4922c0a5a69da0ba$exports = require("./createCalendar.main.js");
12
- var $4ae0260a69729f1d$exports = require("./conversion.main.js");
13
- var $1f0f7ebf1ae6c530$exports = require("./queries.main.js");
14
- var $4c32e2d98e5a5134$exports = require("./string.main.js");
15
- var $8f23a04ae90a588b$exports = require("./DateFormatter.main.js");
16
-
17
-
18
- function $parcel$export(e, n, v, s) {
19
- Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
20
- }
21
-
22
- $parcel$export(module.exports, "CalendarDate", () => $625ad1e1f4c43bc1$exports.CalendarDate);
23
- $parcel$export(module.exports, "CalendarDateTime", () => $625ad1e1f4c43bc1$exports.CalendarDateTime);
24
- $parcel$export(module.exports, "Time", () => $625ad1e1f4c43bc1$exports.Time);
25
- $parcel$export(module.exports, "ZonedDateTime", () => $625ad1e1f4c43bc1$exports.ZonedDateTime);
26
- $parcel$export(module.exports, "GregorianCalendar", () => $af14c9812fdceb33$exports.GregorianCalendar);
27
- $parcel$export(module.exports, "JapaneseCalendar", () => $b0ac0602ef646b2c$exports.JapaneseCalendar);
28
- $parcel$export(module.exports, "BuddhistCalendar", () => $561c4ef058278b74$exports.BuddhistCalendar);
29
- $parcel$export(module.exports, "TaiwanCalendar", () => $9cc5d3577ec40243$exports.TaiwanCalendar);
30
- $parcel$export(module.exports, "PersianCalendar", () => $3c060181fc7249ae$exports.PersianCalendar);
31
- $parcel$export(module.exports, "IndianCalendar", () => $5f1dfa5c67609fe6$exports.IndianCalendar);
32
- $parcel$export(module.exports, "IslamicCivilCalendar", () => $ecb2c4cc8c9aae25$exports.IslamicCivilCalendar);
33
- $parcel$export(module.exports, "IslamicTabularCalendar", () => $ecb2c4cc8c9aae25$exports.IslamicTabularCalendar);
34
- $parcel$export(module.exports, "IslamicUmalquraCalendar", () => $ecb2c4cc8c9aae25$exports.IslamicUmalquraCalendar);
35
- $parcel$export(module.exports, "HebrewCalendar", () => $0f5324ee3bdd9396$exports.HebrewCalendar);
36
- $parcel$export(module.exports, "EthiopicCalendar", () => $4db04d1051af0f2f$exports.EthiopicCalendar);
37
- $parcel$export(module.exports, "EthiopicAmeteAlemCalendar", () => $4db04d1051af0f2f$exports.EthiopicAmeteAlemCalendar);
38
- $parcel$export(module.exports, "CopticCalendar", () => $4db04d1051af0f2f$exports.CopticCalendar);
39
- $parcel$export(module.exports, "createCalendar", () => $4922c0a5a69da0ba$exports.createCalendar);
40
- $parcel$export(module.exports, "toCalendarDate", () => $4ae0260a69729f1d$exports.toCalendarDate);
41
- $parcel$export(module.exports, "toCalendarDateTime", () => $4ae0260a69729f1d$exports.toCalendarDateTime);
42
- $parcel$export(module.exports, "toTime", () => $4ae0260a69729f1d$exports.toTime);
43
- $parcel$export(module.exports, "toCalendar", () => $4ae0260a69729f1d$exports.toCalendar);
44
- $parcel$export(module.exports, "toZoned", () => $4ae0260a69729f1d$exports.toZoned);
45
- $parcel$export(module.exports, "toTimeZone", () => $4ae0260a69729f1d$exports.toTimeZone);
46
- $parcel$export(module.exports, "toLocalTimeZone", () => $4ae0260a69729f1d$exports.toLocalTimeZone);
47
- $parcel$export(module.exports, "fromDate", () => $4ae0260a69729f1d$exports.fromDate);
48
- $parcel$export(module.exports, "fromAbsolute", () => $4ae0260a69729f1d$exports.fromAbsolute);
49
- $parcel$export(module.exports, "isSameDay", () => $1f0f7ebf1ae6c530$exports.isSameDay);
50
- $parcel$export(module.exports, "isSameMonth", () => $1f0f7ebf1ae6c530$exports.isSameMonth);
51
- $parcel$export(module.exports, "isSameYear", () => $1f0f7ebf1ae6c530$exports.isSameYear);
52
- $parcel$export(module.exports, "isEqualDay", () => $1f0f7ebf1ae6c530$exports.isEqualDay);
53
- $parcel$export(module.exports, "isEqualMonth", () => $1f0f7ebf1ae6c530$exports.isEqualMonth);
54
- $parcel$export(module.exports, "isEqualYear", () => $1f0f7ebf1ae6c530$exports.isEqualYear);
55
- $parcel$export(module.exports, "isToday", () => $1f0f7ebf1ae6c530$exports.isToday);
56
- $parcel$export(module.exports, "getDayOfWeek", () => $1f0f7ebf1ae6c530$exports.getDayOfWeek);
57
- $parcel$export(module.exports, "now", () => $1f0f7ebf1ae6c530$exports.now);
58
- $parcel$export(module.exports, "today", () => $1f0f7ebf1ae6c530$exports.today);
59
- $parcel$export(module.exports, "getHoursInDay", () => $1f0f7ebf1ae6c530$exports.getHoursInDay);
60
- $parcel$export(module.exports, "getLocalTimeZone", () => $1f0f7ebf1ae6c530$exports.getLocalTimeZone);
61
- $parcel$export(module.exports, "setLocalTimeZone", () => $1f0f7ebf1ae6c530$exports.setLocalTimeZone);
62
- $parcel$export(module.exports, "resetLocalTimeZone", () => $1f0f7ebf1ae6c530$exports.resetLocalTimeZone);
63
- $parcel$export(module.exports, "startOfMonth", () => $1f0f7ebf1ae6c530$exports.startOfMonth);
64
- $parcel$export(module.exports, "startOfWeek", () => $1f0f7ebf1ae6c530$exports.startOfWeek);
65
- $parcel$export(module.exports, "startOfYear", () => $1f0f7ebf1ae6c530$exports.startOfYear);
66
- $parcel$export(module.exports, "endOfMonth", () => $1f0f7ebf1ae6c530$exports.endOfMonth);
67
- $parcel$export(module.exports, "endOfWeek", () => $1f0f7ebf1ae6c530$exports.endOfWeek);
68
- $parcel$export(module.exports, "endOfYear", () => $1f0f7ebf1ae6c530$exports.endOfYear);
69
- $parcel$export(module.exports, "getMinimumMonthInYear", () => $1f0f7ebf1ae6c530$exports.getMinimumMonthInYear);
70
- $parcel$export(module.exports, "getMinimumDayInMonth", () => $1f0f7ebf1ae6c530$exports.getMinimumDayInMonth);
71
- $parcel$export(module.exports, "getWeeksInMonth", () => $1f0f7ebf1ae6c530$exports.getWeeksInMonth);
72
- $parcel$export(module.exports, "minDate", () => $1f0f7ebf1ae6c530$exports.minDate);
73
- $parcel$export(module.exports, "maxDate", () => $1f0f7ebf1ae6c530$exports.maxDate);
74
- $parcel$export(module.exports, "isWeekend", () => $1f0f7ebf1ae6c530$exports.isWeekend);
75
- $parcel$export(module.exports, "isWeekday", () => $1f0f7ebf1ae6c530$exports.isWeekday);
76
- $parcel$export(module.exports, "isEqualCalendar", () => $1f0f7ebf1ae6c530$exports.isEqualCalendar);
77
- $parcel$export(module.exports, "parseDate", () => $4c32e2d98e5a5134$exports.parseDate);
78
- $parcel$export(module.exports, "parseDateTime", () => $4c32e2d98e5a5134$exports.parseDateTime);
79
- $parcel$export(module.exports, "parseTime", () => $4c32e2d98e5a5134$exports.parseTime);
80
- $parcel$export(module.exports, "parseAbsolute", () => $4c32e2d98e5a5134$exports.parseAbsolute);
81
- $parcel$export(module.exports, "parseAbsoluteToLocal", () => $4c32e2d98e5a5134$exports.parseAbsoluteToLocal);
82
- $parcel$export(module.exports, "parseZonedDateTime", () => $4c32e2d98e5a5134$exports.parseZonedDateTime);
83
- $parcel$export(module.exports, "parseDuration", () => $4c32e2d98e5a5134$exports.parseDuration);
84
- $parcel$export(module.exports, "DateFormatter", () => $8f23a04ae90a588b$exports.DateFormatter);
85
- /*
86
- * Copyright 2020 Adobe. All rights reserved.
87
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
88
- * you may not use this file except in compliance with the License. You may obtain a copy
89
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
90
- *
91
- * Unless required by applicable law or agreed to in writing, software distributed under
92
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
93
- * OF ANY KIND, either express or implied. See the License for the specific language
94
- * governing permissions and limitations under the License.
95
- */
96
-
97
-
98
-
99
-
100
-
101
-
102
-
103
-
104
-
105
-
106
-
107
-
108
-
109
-
110
-
111
-
112
- //# sourceMappingURL=main.js.map
package/dist/main.js.map DELETED
@@ -1 +0,0 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC","sources":["packages/@internationalized/date/src/index.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nexport type {\n AnyCalendarDate,\n AnyTime,\n AnyDateTime,\n Calendar,\n CalendarIdentifier,\n DateDuration,\n TimeDuration,\n DateTimeDuration,\n DateFields,\n TimeFields,\n DateField,\n TimeField,\n Disambiguation,\n CycleOptions,\n CycleTimeOptions\n} from './types';\n\nexport {CalendarDate, CalendarDateTime, Time, ZonedDateTime} from './CalendarDate';\nexport {GregorianCalendar} from './calendars/GregorianCalendar';\nexport {JapaneseCalendar} from './calendars/JapaneseCalendar';\nexport {BuddhistCalendar} from './calendars/BuddhistCalendar';\nexport {TaiwanCalendar} from './calendars/TaiwanCalendar';\nexport {PersianCalendar} from './calendars/PersianCalendar';\nexport {IndianCalendar} from './calendars/IndianCalendar';\nexport {IslamicCivilCalendar, IslamicTabularCalendar, IslamicUmalquraCalendar} from './calendars/IslamicCalendar';\nexport {HebrewCalendar} from './calendars/HebrewCalendar';\nexport {EthiopicCalendar, EthiopicAmeteAlemCalendar, CopticCalendar} from './calendars/EthiopicCalendar';\nexport {createCalendar} from './createCalendar';\nexport {\n toCalendarDate,\n toCalendarDateTime,\n toTime,\n toCalendar,\n toZoned,\n toTimeZone,\n toLocalTimeZone,\n fromDate,\n fromAbsolute\n} from './conversion';\nexport {\n isSameDay,\n isSameMonth,\n isSameYear,\n isEqualDay,\n isEqualMonth,\n isEqualYear,\n isToday,\n getDayOfWeek,\n now,\n today,\n getHoursInDay,\n getLocalTimeZone,\n setLocalTimeZone,\n resetLocalTimeZone,\n startOfMonth,\n startOfWeek,\n startOfYear,\n endOfMonth,\n endOfWeek,\n endOfYear,\n getMinimumMonthInYear,\n getMinimumDayInMonth,\n getWeeksInMonth,\n minDate,\n maxDate,\n isWeekend,\n isWeekday,\n isEqualCalendar\n} from './queries';\nexport {\n parseDate,\n parseDateTime,\n parseTime,\n parseAbsolute,\n parseAbsoluteToLocal,\n parseZonedDateTime,\n parseDuration\n} from './string';\nexport {DateFormatter} from './DateFormatter';\n"],"names":[],"version":3,"file":"main.js.map"}