@formkit/tempo 0.0.19 → 0.1.0

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 (177) hide show
  1. package/dist/addDay.d.ts +9 -0
  2. package/dist/addDay.mjs +11 -0
  3. package/dist/addDay.mjs.map +1 -0
  4. package/dist/addHour.d.ts +9 -0
  5. package/dist/addHour.mjs +11 -0
  6. package/dist/addHour.mjs.map +1 -0
  7. package/dist/addMinute.d.ts +9 -0
  8. package/dist/addMinute.mjs +11 -0
  9. package/dist/addMinute.mjs.map +1 -0
  10. package/dist/addMonth.d.ts +13 -0
  11. package/dist/addMonth.mjs +19 -0
  12. package/dist/addMonth.mjs.map +1 -0
  13. package/dist/addSecond.d.ts +9 -0
  14. package/dist/addSecond.mjs +11 -0
  15. package/dist/addSecond.mjs.map +1 -0
  16. package/dist/addYear.d.ts +13 -0
  17. package/dist/addYear.mjs +19 -0
  18. package/dist/addYear.mjs.map +1 -0
  19. package/dist/ap.d.ts +8 -0
  20. package/dist/ap.mjs +28 -0
  21. package/dist/ap.mjs.map +1 -0
  22. package/dist/applyOffset.d.ts +11 -0
  23. package/dist/applyOffset.mjs +20 -0
  24. package/dist/applyOffset.mjs.map +1 -0
  25. package/dist/bundle.mjs +1215 -0
  26. package/dist/bundle.mjs.map +1 -0
  27. package/dist/common.d.ts +137 -0
  28. package/dist/common.mjs +252 -0
  29. package/dist/common.mjs.map +1 -0
  30. package/dist/date.d.ts +9 -0
  31. package/dist/date.mjs +28 -0
  32. package/dist/date.mjs.map +1 -0
  33. package/dist/dayEnd.d.ts +9 -0
  34. package/dist/dayEnd.mjs +11 -0
  35. package/dist/dayEnd.mjs.map +1 -0
  36. package/dist/dayOfYear.d.ts +10 -0
  37. package/dist/dayOfYear.mjs +12 -0
  38. package/dist/dayOfYear.mjs.map +1 -0
  39. package/dist/dayStart.d.ts +9 -0
  40. package/dist/dayStart.mjs +11 -0
  41. package/dist/dayStart.mjs.map +1 -0
  42. package/dist/deviceLocale.d.ts +7 -0
  43. package/dist/deviceLocale.mjs +8 -0
  44. package/dist/deviceLocale.mjs.map +1 -0
  45. package/dist/deviceTZ.d.ts +8 -0
  46. package/dist/deviceTZ.mjs +8 -0
  47. package/dist/deviceTZ.mjs.map +1 -0
  48. package/dist/diffDays.d.ts +12 -0
  49. package/dist/diffDays.mjs +14 -0
  50. package/dist/diffDays.mjs.map +1 -0
  51. package/dist/diffHours.d.ts +12 -0
  52. package/dist/diffHours.mjs +14 -0
  53. package/dist/diffHours.mjs.map +1 -0
  54. package/dist/diffMilliseconds.d.ts +10 -0
  55. package/dist/diffMilliseconds.mjs +11 -0
  56. package/dist/diffMilliseconds.mjs.map +1 -0
  57. package/dist/diffMinutes.d.ts +11 -0
  58. package/dist/diffMinutes.mjs +10 -0
  59. package/dist/diffMinutes.mjs.map +1 -0
  60. package/dist/diffMonths.d.ts +10 -0
  61. package/dist/diffMonths.mjs +25 -0
  62. package/dist/diffMonths.mjs.map +1 -0
  63. package/dist/diffRound.d.ts +9 -0
  64. package/dist/diffRound.mjs +9 -0
  65. package/dist/diffRound.mjs.map +1 -0
  66. package/dist/diffSeconds.d.ts +12 -0
  67. package/dist/diffSeconds.mjs +10 -0
  68. package/dist/diffSeconds.mjs.map +1 -0
  69. package/dist/diffWeeks.d.ts +12 -0
  70. package/dist/diffWeeks.mjs +14 -0
  71. package/dist/diffWeeks.mjs.map +1 -0
  72. package/dist/diffYears.d.ts +10 -0
  73. package/dist/diffYears.mjs +10 -0
  74. package/dist/diffYears.mjs.map +1 -0
  75. package/dist/format.d.ts +36 -0
  76. package/dist/format.mjs +48 -0
  77. package/dist/format.mjs.map +1 -0
  78. package/dist/formatStr.d.ts +13 -0
  79. package/dist/formatStr.mjs +13 -0
  80. package/dist/formatStr.mjs.map +1 -0
  81. package/dist/fourDigitYear.d.ts +10 -0
  82. package/dist/fourDigitYear.mjs +12 -0
  83. package/dist/fourDigitYear.mjs.map +1 -0
  84. package/dist/hourEnd.d.ts +9 -0
  85. package/dist/hourEnd.mjs +11 -0
  86. package/dist/hourEnd.mjs.map +1 -0
  87. package/dist/hourStart.d.ts +9 -0
  88. package/dist/hourStart.mjs +11 -0
  89. package/dist/hourStart.mjs.map +1 -0
  90. package/dist/index.cjs +139 -20
  91. package/dist/index.cjs.map +1 -1
  92. package/dist/index.d.cts +75 -4
  93. package/dist/index.d.ts +54 -498
  94. package/dist/index.mjs +62 -1057
  95. package/dist/index.mjs.map +1 -1
  96. package/dist/isAfter.d.ts +18 -0
  97. package/dist/isAfter.mjs +11 -0
  98. package/dist/isAfter.mjs.map +1 -0
  99. package/dist/isBefore.d.ts +13 -0
  100. package/dist/isBefore.mjs +11 -0
  101. package/dist/isBefore.mjs.map +1 -0
  102. package/dist/isEqual.d.ts +13 -0
  103. package/dist/isEqual.mjs +11 -0
  104. package/dist/isEqual.mjs.map +1 -0
  105. package/dist/iso8601.d.ts +13 -0
  106. package/dist/iso8601.mjs +27 -0
  107. package/dist/iso8601.mjs.map +1 -0
  108. package/dist/minuteEnd.d.ts +9 -0
  109. package/dist/minuteEnd.mjs +11 -0
  110. package/dist/minuteEnd.mjs.map +1 -0
  111. package/dist/minuteStart.d.ts +9 -0
  112. package/dist/minuteStart.mjs +11 -0
  113. package/dist/minuteStart.mjs.map +1 -0
  114. package/dist/monthDays.d.ts +9 -0
  115. package/dist/monthDays.mjs +10 -0
  116. package/dist/monthDays.mjs.map +1 -0
  117. package/dist/monthEnd.d.ts +10 -0
  118. package/dist/monthEnd.mjs +13 -0
  119. package/dist/monthEnd.mjs.map +1 -0
  120. package/dist/monthStart.d.ts +9 -0
  121. package/dist/monthStart.mjs +12 -0
  122. package/dist/monthStart.mjs.map +1 -0
  123. package/dist/nearestDay.d.ts +12 -0
  124. package/dist/nearestDay.mjs +46 -0
  125. package/dist/nearestDay.mjs.map +1 -0
  126. package/dist/offset.d.ts +14 -0
  127. package/dist/offset.mjs +36 -0
  128. package/dist/offset.mjs.map +1 -0
  129. package/dist/parse.d.ts +13 -0
  130. package/dist/parse.mjs +163 -0
  131. package/dist/parse.mjs.map +1 -0
  132. package/dist/parts.d.ts +12 -0
  133. package/dist/parts.mjs +214 -0
  134. package/dist/parts.mjs.map +1 -0
  135. package/dist/range.d.ts +10 -0
  136. package/dist/range.mjs +50 -0
  137. package/dist/range.mjs.map +1 -0
  138. package/dist/removeOffset.d.ts +10 -0
  139. package/dist/removeOffset.mjs +13 -0
  140. package/dist/removeOffset.mjs.map +1 -0
  141. package/dist/sameDay.d.ts +10 -0
  142. package/dist/sameDay.mjs +11 -0
  143. package/dist/sameDay.mjs.map +1 -0
  144. package/dist/sameHour.d.ts +10 -0
  145. package/dist/sameHour.mjs +11 -0
  146. package/dist/sameHour.mjs.map +1 -0
  147. package/dist/sameMinute.d.ts +10 -0
  148. package/dist/sameMinute.mjs +11 -0
  149. package/dist/sameMinute.mjs.map +1 -0
  150. package/dist/sameSecond.d.ts +10 -0
  151. package/dist/sameSecond.mjs +11 -0
  152. package/dist/sameSecond.mjs.map +1 -0
  153. package/dist/sameYear.d.ts +10 -0
  154. package/dist/sameYear.mjs +11 -0
  155. package/dist/sameYear.mjs.map +1 -0
  156. package/dist/types.d.ts +143 -0
  157. package/dist/types.mjs +1 -0
  158. package/dist/types.mjs.map +1 -0
  159. package/dist/tzDate.d.ts +15 -0
  160. package/dist/tzDate.mjs +12 -0
  161. package/dist/tzDate.mjs.map +1 -0
  162. package/dist/weekEnd.d.ts +12 -0
  163. package/dist/weekEnd.mjs +12 -0
  164. package/dist/weekEnd.mjs.map +1 -0
  165. package/dist/weekStart.d.ts +12 -0
  166. package/dist/weekStart.mjs +15 -0
  167. package/dist/weekStart.mjs.map +1 -0
  168. package/dist/yearDays.d.ts +9 -0
  169. package/dist/yearDays.mjs +10 -0
  170. package/dist/yearDays.mjs.map +1 -0
  171. package/dist/yearEnd.d.ts +9 -0
  172. package/dist/yearEnd.mjs +13 -0
  173. package/dist/yearEnd.mjs.map +1 -0
  174. package/dist/yearStart.d.ts +9 -0
  175. package/dist/yearStart.mjs +13 -0
  176. package/dist/yearStart.mjs.map +1 -0
  177. package/package.json +8 -1
package/dist/index.d.ts CHANGED
@@ -1,498 +1,54 @@
1
- /**
2
- * The date format used as an input value. Either a date or an ISO8601 string.
3
- */
4
- type DateInput = Date | string;
5
- /**
6
- * Format parts with text names use these descriptors:
7
- */
8
- type NamedFormatOption = "long" | "short" | "narrow";
9
- /**
10
- * A registry of named format parts. Each type of part has every option.
11
- */
12
- interface NamedFormats {
13
- weekday: Record<string, NamedFormatOption>;
14
- month: Record<string, NamedFormatOption>;
15
- dayPeriod: Record<string, NamedFormatOption>;
16
- }
17
- /**
18
- * Internal format for "pieces" of a date form. Each part represents a single
19
- * logical grouping, like "month", or "seconds".
20
- */
21
- interface Part {
22
- /**
23
- * An object of partName to partValue For example:
24
- * ```js
25
- * { hour: '2-digit' }
26
- * ```
27
- */
28
- option: FormatPattern[1];
29
- /**
30
- * The name of the part, these must be valid parts of a date format as
31
- * specified in Intl.DateTimeFormatPartTypes. Valid values are:
32
- * day, dayPeriod, era, hour, literal, minute, month, second, timeZoneName,
33
- * weekday, year
34
- */
35
- partName: Intl.DateTimeFormatPartTypes;
36
- /**
37
- * The value of a given part. For example "2-digit", or "narrow".
38
- */
39
- partValue: string;
40
- /**
41
- * The string token that represents the regex. For example "YYYY".
42
- */
43
- token: string;
44
- /**
45
- * A regular expression if the above token.
46
- */
47
- pattern: RegExp;
48
- /**
49
- * Does this part require a the hour12 clock.
50
- */
51
- hour12: boolean;
52
- }
53
- /**
54
- * A date part with an actual value applied.
55
- */
56
- type FilledPart = Part & {
57
- value: string;
58
- };
59
- /**
60
- * A tuple describing a given formatting token.
61
- */
62
- type FormatPattern = [
63
- pattern: FormatToken | string,
64
- option: Partial<Record<Intl.DateTimeFormatPartTypes, string>>,
65
- exp?: RegExp
66
- ];
67
- /**
68
- * Possible options for a format style.
69
- */
70
- type FormatStyle = "full" | "long" | "medium" | "short";
71
- /**
72
- * Possible objects for the dateStyle and timeStyle.
73
- */
74
- type FormatStyleObj = {
75
- date: FormatStyle;
76
- time: FormatStyle;
77
- } | {
78
- date: FormatStyle;
79
- } | {
80
- time: FormatStyle;
81
- };
82
- type Format = FormatStyle | FormatStyleObj | string;
83
- /**
84
- * A union of all available formatting tokens.
85
- */
86
- type FormatToken = "YYYY" | "YY" | "MMMM" | "MMM" | "MM" | "M" | "DD" | "D" | "dddd" | "ddd" | "d" | "mm" | "m" | "ss" | "s" | "HH" | "H" | "hh" | "h" | "a" | "A" | "ZZ" | "Z";
87
- interface ParseOptions {
88
- /**
89
- * A string representing a date.
90
- */
91
- date: string;
92
- /**
93
- * The format that should be used to parse the date. This is a string composed
94
- * of tokens.
95
- */
96
- format: Format;
97
- /**
98
- * The locale used to parse the date.
99
- */
100
- locale: string;
101
- /**
102
- * A function that can be used to filter out parts of the format. This is
103
- * useful when using the native Intl formats like
104
- * `{ date: 'full', time: 'full' }` and not wanting to keep all the parts of
105
- * the given format.
106
- */
107
- partFilter?: (part: Part) => boolean;
108
- /**
109
- * The behavior to use when a date overflows a given month. For example, if
110
- * the date to parse is February 29, 2023 — there is no 29th day of February.
111
- * In this case overflow "forward" would result in March 1, 2023, "backward"
112
- * would result in February 28, 2023, and "throw" would throw an error.
113
- */
114
- dateOverflow?: "forward" | "backward" | "throw";
115
- }
116
- interface FormatOptions {
117
- /**
118
- * A date object or ISO 8601 string.
119
- */
120
- date: DateInput;
121
- /**
122
- * A format string or object.
123
- */
124
- format: Format;
125
- /**
126
- * A locale or en by default.
127
- */
128
- locale?: string;
129
- /**
130
- * Whether or not to escape literals.
131
- */
132
- genitive?: boolean;
133
- /**
134
- * A function to filter parts.
135
- */
136
- tz?: string;
137
- /**
138
- * A function to filter parts.
139
- */
140
- partFilter?: (part: Part) => boolean;
141
- }
142
-
143
- /**
144
- * Returns a new date object 1/n days after the original one.
145
- * @param inputDate - A date to increment by 1 day.
146
- */
147
- declare function addDay(inputDate: DateInput, count?: number): Date;
148
-
149
- /**
150
- * Returns a new date object 1/n months after the original one. Keep in mind if you
151
- * start with a date late in a given month you could get a date after the next
152
- * month.
153
- * @param inputDate - A date to increment by 1 or more months.
154
- * @param count - The quantity to add.
155
- * @param dateOverflow - Whether or not to allow the date to overflow to another month if the inputDate’s month is out of range of the new month.
156
- */
157
- declare function addMonth(inputDate: DateInput, count?: number, dateOverflow?: boolean): Date;
158
-
159
- /**
160
- * Returns a new date object 1/n years after the original one. Keep in mind if
161
- * you start with a date late in a given month you could get a date after the
162
- * next month.
163
- * @param inputDate - A date to increment by 1 day.
164
- * @param count - The quantity of years add.
165
- * @param dateOverflow - Whether or not to allow the date to overflow to another month if the inputDate’s month is out of range of the new month.
166
- */
167
- declare function addYear(inputDate: DateInput, count?: number, dateOverflow?: boolean): Date;
168
-
169
- /**
170
- * Returns a new date object 1/n hours after the original one.
171
- * @param inputDate - A date to increment by 1 day.
172
- */
173
- declare function addHour(inputDate: DateInput, count?: number): Date;
174
-
175
- /**
176
- * Returns a new date object 1/n seconds after the original one.
177
- * @param inputDate - A date to increment by 1 day.
178
- */
179
- declare function addMinute(inputDate: DateInput, count?: number): Date;
180
-
181
- /**
182
- * Returns a new date object 1/n seconds after the original one.
183
- * @param inputDate - A date to increment by 1 day.
184
- */
185
- declare function addSecond(inputDate: DateInput, count?: number): Date;
186
-
187
- /**
188
- * Determines the correct value for am/pm by locale and memoizes it.
189
- * @param ampm - am or pm
190
- * @param locale - The locale to fetch.
191
- */
192
- declare function ap(ampm: "am" | "pm", locale: string): string;
193
-
194
- /**
195
- * Apply a given offset to a date, returning a new date with the offset
196
- * applied by adding or subtracting the given number of minutes.
197
- * @param dateInput - The date to apply the offset to.
198
- * @param offset - The offset to apply in the +-HHmm format.
199
- */
200
- declare function applyOffset(dateInput: DateInput, offset?: string): Date;
201
-
202
- /**
203
- * A date to parse.
204
- * @param date - A Date object or an ISO 8601 date.
205
- */
206
- declare function date(date?: DateInput): Date;
207
-
208
- /**
209
- * Creates a date object for the input date at the given timezone. For example
210
- * `tzDate("2017-05-06T12:00", "Europe/Amsterdam")` will return a date object
211
- * for 2017-05-06T10:00:00Z since 12:00 in Amsterdam is 10:00Z.
212
- *
213
- * If given a Date object it will use local time and convert it to the given
214
- * timezone, thus "changing" the date.
215
- * @param inputDate - An iso8601 date string with no timezone
216
- * @param tz - A timezone string
217
- */
218
- declare function tzDate(inputDate: DateInput, tz: string): Date;
219
-
220
- /**
221
- * Gets the what day of the year a given date is. For example, August 1st is
222
- * the 213th day of the year on non- years and 214th on leap years.
223
- * @param inputDate - The input date.
224
- */
225
- declare function dayOfYear(inputDate: DateInput): number;
226
-
227
- /**
228
- * Returns a Date object for end of the given day.
229
- * @param inputDate - A string or Date object
230
- */
231
- declare function dayEnd(inputDate: DateInput): Date;
232
-
233
- /**
234
- * Returns a Date object for start of the given day.
235
- * @param inputDate - A string or Date object
236
- */
237
- declare function dayStart(inputDate: DateInput): Date;
238
-
239
- /**
240
- * Produce a formatted string. Available strings:
241
- * token | description
242
- * ------|------------
243
- * YY | 2 digit year
244
- * YYYY | 4 digit year
245
- * M | The month 1-12
246
- * MM | The month 01-12
247
- * MMM | Short name Jan-Dec
248
- * MMMM | Full name January | December
249
- * D | The day of the month 1-31
250
- * DD | The day of the month 01-31
251
- * d | Single digit day "T"
252
- * ddd | Short day name Thu
253
- * dddd | Full day name Wednesday
254
- * H | Minimum hour digits, 24 hour, 0-23
255
- * HH | 2 hour digits, 24 hour, 00-23
256
- * h | Minimum hour digits, 12 hour clock, 1-12
257
- * hh | 2 hour digits, 12 hour clock, 01-12
258
- * m | The minute 0-59
259
- * mm | The minute 00-59
260
- * s | The second 0-59
261
- * ss | The second 00-59
262
- * a | am/pm
263
- * A | AM/PM
264
- * Z | +0800, +0530, -1345
265
- *
266
- * @param inputDate - A date object or ISO 8601 string
267
- * @param format - A format
268
- */
269
- declare function format(options: FormatOptions): string;
270
- declare function format(inputDate: DateInput, format?: Format, locale?: string, genitive?: boolean, partFilter?: (part: Part) => boolean): string;
271
-
272
- /**
273
- * Return the string format for a given format. For example:
274
- * ```js
275
- * formatStr({ date: 'long' }, 'en') // dddd, MMMM D, YYYY
276
- * ```
277
- * @param format - A format string or object.
278
- * @param locale - A locale or en by default.
279
- */
280
- declare function formatStr(format: Format, locale?: string, escapeLiterals?: boolean, filterParts?: (part: Part) => boolean): string;
281
-
282
- /**
283
- * Converts a 2 digit year into a 4 digit year. This function assumes years 20
284
- * years into the future belong to the current century, and the past 80 are in
285
- * the past.
286
- *
287
- * @param value - 2 digits in string format
288
- */
289
- declare function fourDigitYear(value: string): number;
290
-
291
- /**
292
- * Returns a Date object for end of the given hour.
293
- * @param inputDate - A string or Date object
294
- */
295
- declare function hourEnd(inputDate: DateInput): Date;
296
-
297
- /**
298
- * Returns a Date object for start of the given hour.
299
- * @param inputDate - A string or Date object
300
- */
301
- declare function hourStart(inputDate: DateInput): Date;
302
-
303
- /**
304
- * True when the date string is valid ISO 8601.
305
- * @param date - A date string.
306
- */
307
- declare function iso8601(date: string): boolean;
308
-
309
- /**
310
- * Returns a Date object for end of the given minute.
311
- * @param inputDate - A string or Date object
312
- */
313
- declare function minuteEnd(inputDate: DateInput): Date;
314
-
315
- /**
316
- * Returns a Date object for start of the given minute.
317
- * @param inputDate - A string or Date object
318
- */
319
- declare function minuteStart(inputDate: DateInput): Date;
320
-
321
- /**
322
- * Returns the total number of days from a given month.
323
- * @param inputDate - A string or Date object
324
- */
325
- declare function monthDays(inputDate: DateInput): number;
326
-
327
- /**
328
- * Returns a Date object for the with the input date set to the last day of
329
- * the current month. Does not change the time.
330
- * @param inputDate - A string or Date object
331
- */
332
- declare function monthEnd(inputDate: DateInput): Date;
333
-
334
- /**
335
- * Returns a Date object for the first day of a month.
336
- * @param inputDate - A string or Date object
337
- */
338
- declare function monthStart(inputDate: DateInput): Date;
339
-
340
- /**
341
- * Performs a bidirectional search for the nearest date that passes a function.
342
- * @param target - Performs a search for the nearest passing date.
343
- * @param search - The search function to use, given a date returns a boolean.
344
- * @param constraint - The number of iterations to perform before giving up, or logical constraint like "month", or "week".
345
- *
346
- */
347
- declare function nearestDay(inputDate: DateInput, search: (date: Date) => boolean, constraint?: number | "month" | "week" | "year"): Date | null;
348
-
349
- /**
350
- * Returns the offset between two timezones on a given date. The results are
351
- * ISO8601 compatible offsets like -0800 or +0530.
352
- *
353
- * @param dateInput - The date on which to determine the offset.
354
- * @param tzA - (default: UTC) The second timezone to compare determine the offset between.
355
- * @param tzB - (default: device) The first timezone to compare determine the offset between.
356
- */
357
- declare function offset(utcTime: DateInput, tzA?: string, tzB?: string): string;
358
-
359
- declare function parse(options: ParseOptions): Date | never;
360
- declare function parse(dateStr: string, format?: Format, locale?: string): Date | never;
361
- /**
362
- * Given a string date and corresponding format parts, fill the parts with the
363
- * data from the string.
364
- * @param dateStr - A string to parse.
365
- * @param formatParts - The expected parts of the given string.
366
- */
367
- declare function parseParts(dateStr: string, formatParts: Part[]): FilledPart[];
368
-
369
- /**
370
- * Given a format string, produce an array of matching "parts", each part
371
- * contains a regular expression and the corresponding
372
- * Intl.DateTimeFormatPartTypesRegistry key/value.
373
- * @param format - A format string like MM/DD/YYYY
374
- * @param locale - The locale to parse for.
375
- */
376
- declare function parts(format: Format, locale: string): Part[];
377
-
378
- /**
379
- * Returns an array of options for a given token in a given locale.
380
- * @param token - Get the full range of options for a given token
381
- * @param locale - The locale to fetch the options for.
382
- */
383
- declare function range(token: FormatToken, locale?: string, genitive?: boolean): string[];
384
-
385
- /**
386
- * Inverts the offset and applies it to the given date, returning a new date.
387
- * @param dateInput - The date to remove the offset from.
388
- * @param offset - The offset to remove in the +-HHmm format.
389
- */
390
- declare function removeOffset(dateInput: DateInput, offset?: string): Date;
391
-
392
- /**
393
- * Checks if two date objects refer to the same date. Ignores time.
394
- * @param inputDateA - First date to compare
395
- * @param inputDateB - Second date to compare
396
- */
397
- declare function sameDay(inputDateA: DateInput, inputDateB: DateInput): boolean;
398
-
399
- /**
400
- * Checks if two date objects refer to the same time seconds. Ignores date.
401
- * @param inputDateA - First date to compare
402
- * @param inputDateB - Second date to compare
403
- */
404
- declare function sameSecond(inputDateA: DateInput, inputDateB: DateInput): boolean;
405
-
406
- /**
407
- * Checks if two date objects refer to the same time minutes. Ignores date.
408
- * @param inputDateA - First date to compare
409
- * @param inputDateB - Second date to compare
410
- */
411
- declare function sameMinute(inputDateA: DateInput, inputDateB: DateInput): boolean;
412
-
413
- /**
414
- * Checks if two date objects refer to the same time hour. Ignores date.
415
- * @param inputDateA - First date to compare
416
- * @param inputDateB - Second date to compare
417
- */
418
- declare function sameHour(inputDateA: DateInput, inputDateB: DateInput): boolean;
419
-
420
- /**
421
- * Checks if two date objects refer to the same year.
422
- * @param inputDateA - First date to compare
423
- * @param inputDateB - Second date to compare
424
- */
425
- declare function sameYear(inputDateA: DateInput, inputDateB: DateInput): boolean;
426
-
427
- /**
428
- * Returns a Date object for the last day at the last second of the given week.
429
- * Defaults to Sunday as the first day of the week:
430
- * 0 = Sunday ... 6 = Saturday
431
- * @param inputDate - Gets the last day of the week
432
- * @param startOfWeekDay - The first day of the week
433
- */
434
- declare function weekEnd(inputDate: DateInput, startOfWeekDay?: number): Date;
435
-
436
- /**
437
- * Returns a Date object for start of the given week. Defaults to Sunday as the
438
- * first day of the week:
439
- * 0 = Sunday ... 6 = Saturday
440
- * @param inputDate - A string or Date object
441
- * @param startOfWeekDay - Determines which day of the week is the first
442
- */
443
- declare function weekStart(inputDate: DateInput, startOfWeekDay?: number): Date;
444
-
445
- /**
446
- * Get the number of days in the given date’s year.
447
- * @param inputDate - A string or Date object
448
- */
449
- declare function yearDays(inputDate: DateInput): number;
450
-
451
- /**
452
- * Returns a Date object for the with the input date set to the start of the current year.
453
- * @param inputDate - A string or Date object
454
- */
455
- declare function yearStart(inputDate: DateInput): Date;
456
-
457
- /**
458
- * Returns a Date object for the with the input date set to the end of the current year.
459
- * @param inputDate - A string or Date object
460
- */
461
- declare function yearEnd(inputDate: DateInput): Date;
462
-
463
- /**
464
- * Is the first date before the second one?
465
- *
466
- * @param inputDate - The date that should be before the other one to return true
467
- * @param dateToCompare - The date to compare with
468
- *
469
- * @returns The first date is before the second date.
470
- */
471
- declare function isBefore(inputDate: DateInput, dateToCompare: DateInput): boolean;
472
-
473
- /**
474
- * @name isAfter
475
- * @category Common Helpers
476
- * @summary Is the first date after the second one?
477
- *
478
- * @description
479
- * Is the first date after the second one?
480
- *
481
- * @param inputDate - The date that should be after the other one to return true
482
- * @param dateToCompare - The date to compare with
483
- *
484
- * @returns The first date is after the second date.
485
- */
486
- declare function isAfter(inputDate: DateInput, dateToCompare: DateInput): boolean;
487
-
488
- /**
489
- * Are the given dates equal?
490
- *
491
- * @param dateLeft - The first date to compare
492
- * @param dateRight - The second date to compare
493
- *
494
- * @returns The dates are equal.
495
- */
496
- declare function isEqual(dateLeft: DateInput, dateRight: DateInput): boolean;
497
-
498
- export { type DateInput, type FilledPart, type Format, type FormatOptions, type FormatPattern, type FormatStyle, type FormatStyleObj, type FormatToken, type NamedFormatOption, type NamedFormats, type ParseOptions, type Part, addDay, addHour, addMinute, addMonth, addSecond, addYear, ap, applyOffset, date, dayEnd, dayOfYear, dayStart, format, formatStr, fourDigitYear, hourEnd, hourStart, isAfter, isBefore, isEqual, iso8601, minuteEnd, minuteStart, monthDays, monthEnd, monthStart, nearestDay, offset, parse, parseParts, parts, range, removeOffset, sameDay, sameHour, sameMinute, sameSecond, sameYear, tzDate, weekEnd, weekStart, yearDays, yearEnd, yearStart };
1
+ export { addDay } from './addDay.js';
2
+ export { addMonth } from './addMonth.js';
3
+ export { addYear } from './addYear.js';
4
+ export { addHour } from './addHour.js';
5
+ export { addMinute } from './addMinute.js';
6
+ export { addSecond } from './addSecond.js';
7
+ export { ap } from './ap.js';
8
+ export { applyOffset } from './applyOffset.js';
9
+ export { date } from './date.js';
10
+ export { tzDate } from './tzDate.js';
11
+ export { dayOfYear } from './dayOfYear.js';
12
+ export { dayEnd } from './dayEnd.js';
13
+ export { dayStart } from './dayStart.js';
14
+ export { format } from './format.js';
15
+ export { formatStr } from './formatStr.js';
16
+ export { fourDigitYear } from './fourDigitYear.js';
17
+ export { hourEnd } from './hourEnd.js';
18
+ export { hourStart } from './hourStart.js';
19
+ export { iso8601 } from './iso8601.js';
20
+ export { minuteEnd } from './minuteEnd.js';
21
+ export { minuteStart } from './minuteStart.js';
22
+ export { monthDays } from './monthDays.js';
23
+ export { monthEnd } from './monthEnd.js';
24
+ export { monthStart } from './monthStart.js';
25
+ export { nearestDay } from './nearestDay.js';
26
+ export { offset } from './offset.js';
27
+ export { parse, parseParts } from './parse.js';
28
+ export { parts } from './parts.js';
29
+ export { range } from './range.js';
30
+ export { removeOffset } from './removeOffset.js';
31
+ export { sameDay } from './sameDay.js';
32
+ export { sameSecond } from './sameSecond.js';
33
+ export { sameMinute } from './sameMinute.js';
34
+ export { sameHour } from './sameHour.js';
35
+ export { sameYear } from './sameYear.js';
36
+ export { weekEnd } from './weekEnd.js';
37
+ export { weekStart } from './weekStart.js';
38
+ export { yearDays } from './yearDays.js';
39
+ export { yearStart } from './yearStart.js';
40
+ export { yearEnd } from './yearEnd.js';
41
+ export { isBefore } from './isBefore.js';
42
+ export { isAfter } from './isAfter.js';
43
+ export { isEqual } from './isEqual.js';
44
+ export { DateInput, FilledPart, Format, FormatOptions, FormatPattern, FormatStyle, FormatStyleObj, FormatToken, NamedFormatOption, NamedFormats, ParseOptions, Part } from './types.js';
45
+ export { diffMilliseconds } from './diffMilliseconds.js';
46
+ export { diffSeconds } from './diffSeconds.js';
47
+ export { diffMinutes } from './diffMinutes.js';
48
+ export { diffHours } from './diffHours.js';
49
+ export { diffDays } from './diffDays.js';
50
+ export { diffWeeks } from './diffWeeks.js';
51
+ export { diffMonths } from './diffMonths.js';
52
+ export { diffYears } from './diffYears.js';
53
+ import './common.js';
54
+ import './diffRound.js';