@himanshu-sorathiya/react-kit 1.0.23 → 1.0.24
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.
- package/dist/index.d.ts +5 -184
- package/dist/index.js +6 -7
- package/dist/performance2.js +2 -2
- package/dist/state.d.ts +5 -6
- package/package.json +2 -6
- package/dist/datetime.d.ts +0 -182
- package/dist/datetime.js +0 -594
package/dist/index.d.ts
CHANGED
|
@@ -3,184 +3,6 @@
|
|
|
3
3
|
import React$1 from 'react';
|
|
4
4
|
import { CSSProperties, Key, RefObject } from 'react';
|
|
5
5
|
|
|
6
|
-
export type DateInput = Date | number | string;
|
|
7
|
-
export type WeekStartsOn = 0 | 1 | 2 | 3 | 4 | 5 | 6;
|
|
8
|
-
export type DateInterval = {
|
|
9
|
-
start: Date;
|
|
10
|
-
end: Date;
|
|
11
|
-
};
|
|
12
|
-
export type DateRange = {
|
|
13
|
-
start: Date;
|
|
14
|
-
end: Date;
|
|
15
|
-
};
|
|
16
|
-
export type Duration = {
|
|
17
|
-
years?: number;
|
|
18
|
-
months?: number;
|
|
19
|
-
weeks?: number;
|
|
20
|
-
days?: number;
|
|
21
|
-
hours?: number;
|
|
22
|
-
minutes?: number;
|
|
23
|
-
seconds?: number;
|
|
24
|
-
};
|
|
25
|
-
export declare function toDate(input: DateInput): Date;
|
|
26
|
-
export declare function isDate(value: unknown): value is Date;
|
|
27
|
-
export declare function isValid(date: Date): boolean;
|
|
28
|
-
export declare function createDate(year: number, month: number, day?: number): Date;
|
|
29
|
-
export declare function getYear(date: DateInput): number;
|
|
30
|
-
export declare function getMonth(date: DateInput): number;
|
|
31
|
-
export declare function getDate(date: DateInput): number;
|
|
32
|
-
export declare function getHours(date: DateInput): number;
|
|
33
|
-
export declare function getMinutes(date: DateInput): number;
|
|
34
|
-
export declare function getSeconds(date: DateInput): number;
|
|
35
|
-
export declare function getMilliseconds(date: DateInput): number;
|
|
36
|
-
export declare function getTimestamp(date: DateInput): number;
|
|
37
|
-
export declare function getDayOfWeek(date: DateInput): number;
|
|
38
|
-
export declare function getDaysInMonth(date: DateInput): number;
|
|
39
|
-
export declare function getQuarter(date: DateInput): number;
|
|
40
|
-
export declare function getDayOfYear(date: DateInput): number;
|
|
41
|
-
declare const TOKEN_FORMATTERS: {
|
|
42
|
-
yyyy: (d: Date) => string;
|
|
43
|
-
yy: (d: Date) => string;
|
|
44
|
-
MMMM: (d: Date, loc: string) => string;
|
|
45
|
-
MMM: (d: Date, loc: string) => string;
|
|
46
|
-
MM: (d: Date) => string;
|
|
47
|
-
M: (d: Date) => string;
|
|
48
|
-
dd: (d: Date) => string;
|
|
49
|
-
d: (d: Date) => string;
|
|
50
|
-
EEEE: (d: Date, loc: string) => string;
|
|
51
|
-
EEE: (d: Date, loc: string) => string;
|
|
52
|
-
E: (d: Date, loc: string) => string;
|
|
53
|
-
HH: (d: Date) => string;
|
|
54
|
-
H: (d: Date) => string;
|
|
55
|
-
hh: (d: Date) => string;
|
|
56
|
-
h: (d: Date) => string;
|
|
57
|
-
mm: (d: Date) => string;
|
|
58
|
-
ss: (d: Date) => string;
|
|
59
|
-
SSS: (d: Date) => string;
|
|
60
|
-
a: (d: Date, loc: string) => string;
|
|
61
|
-
Q: (d: Date) => string;
|
|
62
|
-
w: (d: Date) => string;
|
|
63
|
-
D: (d: Date) => string;
|
|
64
|
-
xxx: (d: Date) => string;
|
|
65
|
-
xx: (d: Date) => string;
|
|
66
|
-
x: (d: Date) => string;
|
|
67
|
-
};
|
|
68
|
-
export type FormatToken = keyof typeof TOKEN_FORMATTERS;
|
|
69
|
-
export declare function format(date: DateInput, formatString: string, options?: {
|
|
70
|
-
locale?: string;
|
|
71
|
-
}): string;
|
|
72
|
-
export declare function formatDate(date: DateInput, locale?: string, options?: Intl.DateTimeFormatOptions): string;
|
|
73
|
-
export declare function formatRelativeTime(date: DateInput, baseDate?: DateInput, locale?: string): string;
|
|
74
|
-
export declare function formatISO(date: DateInput, options?: {
|
|
75
|
-
format?: "extended" | "basic";
|
|
76
|
-
representation?: "complete" | "date" | "time";
|
|
77
|
-
}): string;
|
|
78
|
-
export declare function formatRFC3339(date: DateInput, options?: {
|
|
79
|
-
fractionDigits?: 0 | 1 | 2 | 3;
|
|
80
|
-
}): string;
|
|
81
|
-
export declare function formatISO9075(date: DateInput, options?: {
|
|
82
|
-
representation?: "complete" | "date" | "time";
|
|
83
|
-
}): string;
|
|
84
|
-
export declare function formatRFC2822(date: DateInput): string;
|
|
85
|
-
export declare function formatDuration(duration: Duration, options?: {
|
|
86
|
-
format?: ReadonlyArray<keyof Duration>;
|
|
87
|
-
zero?: boolean;
|
|
88
|
-
delimiter?: string;
|
|
89
|
-
locale?: string;
|
|
90
|
-
}): string;
|
|
91
|
-
export declare function toISOString(date: DateInput): string;
|
|
92
|
-
export declare function parseISO(isoString: string): Date;
|
|
93
|
-
export declare function addMilliseconds(date: DateInput, amount: number): Date;
|
|
94
|
-
export declare function addSeconds(date: DateInput, amount: number): Date;
|
|
95
|
-
export declare function addMinutes(date: DateInput, amount: number): Date;
|
|
96
|
-
export declare function addHours(date: DateInput, amount: number): Date;
|
|
97
|
-
export declare function addDays(date: DateInput, amount: number): Date;
|
|
98
|
-
export declare function addWeeks(date: DateInput, amount: number): Date;
|
|
99
|
-
export declare function addMonths(date: DateInput, amount: number): Date;
|
|
100
|
-
export declare function addYears(date: DateInput, amount: number): Date;
|
|
101
|
-
export declare function subMilliseconds(date: DateInput, amount: number): Date;
|
|
102
|
-
export declare function subSeconds(date: DateInput, amount: number): Date;
|
|
103
|
-
export declare function subMinutes(date: DateInput, amount: number): Date;
|
|
104
|
-
export declare function subHours(date: DateInput, amount: number): Date;
|
|
105
|
-
export declare function subDays(date: DateInput, amount: number): Date;
|
|
106
|
-
export declare function subWeeks(date: DateInput, amount: number): Date;
|
|
107
|
-
export declare function subMonths(date: DateInput, amount: number): Date;
|
|
108
|
-
export declare function subYears(date: DateInput, amount: number): Date;
|
|
109
|
-
export declare function setYear(date: DateInput, year: number): Date;
|
|
110
|
-
export declare function setMonth(date: DateInput, month: number): Date;
|
|
111
|
-
export declare function setDate(date: DateInput, day: number): Date;
|
|
112
|
-
export declare function setHours(date: DateInput, hours: number): Date;
|
|
113
|
-
export declare function setMinutes(date: DateInput, minutes: number): Date;
|
|
114
|
-
export declare function setSeconds(date: DateInput, seconds: number): Date;
|
|
115
|
-
export declare function setMilliseconds(date: DateInput, ms: number): Date;
|
|
116
|
-
export declare function startOfDay(date: DateInput): Date;
|
|
117
|
-
export declare function endOfDay(date: DateInput): Date;
|
|
118
|
-
export declare function startOfHour(date: DateInput): Date;
|
|
119
|
-
export declare function endOfHour(date: DateInput): Date;
|
|
120
|
-
export declare function startOfMinute(date: DateInput): Date;
|
|
121
|
-
export declare function endOfMinute(date: DateInput): Date;
|
|
122
|
-
export declare function startOfWeek(date: DateInput, weekStartsOn?: WeekStartsOn): Date;
|
|
123
|
-
export declare function endOfWeek(date: DateInput, weekStartsOn?: WeekStartsOn): Date;
|
|
124
|
-
export declare function startOfMonth(date: DateInput): Date;
|
|
125
|
-
export declare function endOfMonth(date: DateInput): Date;
|
|
126
|
-
export declare function startOfQuarter(date: DateInput): Date;
|
|
127
|
-
export declare function endOfQuarter(date: DateInput): Date;
|
|
128
|
-
export declare function startOfYear(date: DateInput): Date;
|
|
129
|
-
export declare function endOfYear(date: DateInput): Date;
|
|
130
|
-
export declare function differenceInMilliseconds(dateLeft: DateInput, dateRight: DateInput): number;
|
|
131
|
-
export declare function differenceInSeconds(dateLeft: DateInput, dateRight: DateInput): number;
|
|
132
|
-
export declare function differenceInMinutes(dateLeft: DateInput, dateRight: DateInput): number;
|
|
133
|
-
export declare function differenceInHours(dateLeft: DateInput, dateRight: DateInput): number;
|
|
134
|
-
export declare function differenceInDays(dateLeft: DateInput, dateRight: DateInput): number;
|
|
135
|
-
export declare function differenceInWeeks(dateLeft: DateInput, dateRight: DateInput): number;
|
|
136
|
-
export declare function differenceInMonths(dateLeft: DateInput, dateRight: DateInput): number;
|
|
137
|
-
export declare function differenceInYears(dateLeft: DateInput, dateRight: DateInput): number;
|
|
138
|
-
export declare function addBusinessDays(date: DateInput, amount: number): Date;
|
|
139
|
-
export declare function differenceInBusinessDays(dateLeft: DateInput, dateRight: DateInput): number;
|
|
140
|
-
export declare function clampDate(date: DateInput, min: DateInput, max: DateInput): Date;
|
|
141
|
-
export declare function min(dates: Date[]): Date | null;
|
|
142
|
-
export declare function max(dates: Date[]): Date | null;
|
|
143
|
-
export declare function closestTo(date: DateInput, datesArray: Date[]): Date | null;
|
|
144
|
-
export declare function eachDayOfInterval(interval: DateInterval): Date[];
|
|
145
|
-
export declare function eachMonthOfInterval(interval: DateInterval): Date[];
|
|
146
|
-
export declare function eachYearOfInterval(interval: DateInterval): Date[];
|
|
147
|
-
export declare function fromUnixTime(seconds: number): Date;
|
|
148
|
-
export declare function toUnixTime(date: DateInput): number;
|
|
149
|
-
export declare function roundToNearestMinutes(date: DateInput, step: number): Date;
|
|
150
|
-
export declare function getISOWeek(date: DateInput): number;
|
|
151
|
-
export declare function setISOWeek(date: DateInput, week: number): Date;
|
|
152
|
-
export declare function intervalToDuration(interval: DateInterval): Duration;
|
|
153
|
-
export declare function durationToMilliseconds(duration: Duration): number;
|
|
154
|
-
export declare function isSameDay(dateA: DateInput, dateB: DateInput): boolean;
|
|
155
|
-
export declare function isSameMonth(dateA: DateInput, dateB: DateInput): boolean;
|
|
156
|
-
export declare function isSameYear(dateA: DateInput, dateB: DateInput): boolean;
|
|
157
|
-
export declare function isSameQuarter(dateA: DateInput, dateB: DateInput): boolean;
|
|
158
|
-
export declare function isSameWeek(dateA: DateInput, dateB: DateInput, weekStartsOn?: WeekStartsOn): boolean;
|
|
159
|
-
export declare function isSameHour(dateA: DateInput, dateB: DateInput): boolean;
|
|
160
|
-
export declare function isSameMinute(dateA: DateInput, dateB: DateInput): boolean;
|
|
161
|
-
export declare function isSameSecond(dateA: DateInput, dateB: DateInput): boolean;
|
|
162
|
-
export declare function isSameTime(dateA: DateInput, dateB: DateInput): boolean;
|
|
163
|
-
export declare function isBefore(date: DateInput, compareDate: DateInput): boolean;
|
|
164
|
-
export declare function isAfter(date: DateInput, compareDate: DateInput): boolean;
|
|
165
|
-
export declare function isEqual(dateA: DateInput, dateB: DateInput): boolean;
|
|
166
|
-
export declare function isWithinRange(date: DateInput, start: DateInput, end: DateInput): boolean;
|
|
167
|
-
export declare function isOverlapping(rangeA: DateRange, rangeB: DateRange): boolean;
|
|
168
|
-
export declare function isToday(date: DateInput): boolean;
|
|
169
|
-
export declare function isYesterday(date: DateInput): boolean;
|
|
170
|
-
export declare function isTomorrow(date: DateInput): boolean;
|
|
171
|
-
export declare function isPast(date: DateInput): boolean;
|
|
172
|
-
export declare function isFuture(date: DateInput): boolean;
|
|
173
|
-
export declare function isThisWeek(date: DateInput, weekStartsOn?: WeekStartsOn): boolean;
|
|
174
|
-
export declare function isThisMonth(date: DateInput): boolean;
|
|
175
|
-
export declare function isThisYear(date: DateInput): boolean;
|
|
176
|
-
export declare function isFirstDayOfMonth(date: DateInput): boolean;
|
|
177
|
-
export declare function isLastDayOfMonth(date: DateInput): boolean;
|
|
178
|
-
export declare function isWeekend(date: DateInput): boolean;
|
|
179
|
-
export declare function isWeekday(date: DateInput): boolean;
|
|
180
|
-
export declare function isAM(date: DateInput): boolean;
|
|
181
|
-
export declare function isPM(date: DateInput): boolean;
|
|
182
|
-
export declare function isLeapYear(yearOrDate: number | Date): boolean;
|
|
183
|
-
export declare function isInLeapYear(date: DateInput): boolean;
|
|
184
6
|
export type ClickOutsideEvent = MouseEvent | TouchEvent | PointerEvent | Event;
|
|
185
7
|
export type ClickOutsideTarget = HTMLElement | null;
|
|
186
8
|
export type ClickOutsideTargetRef = React$1.RefObject<ClickOutsideTarget> | ClickOutsideTarget;
|
|
@@ -585,17 +407,16 @@ export interface UsePaginationReturn<T> {
|
|
|
585
407
|
resetPagination: () => void;
|
|
586
408
|
}
|
|
587
409
|
export declare function usePagination<T>(data: T[] | undefined, initialPageSize: number, initialPageIndex?: number): UsePaginationReturn<T>;
|
|
588
|
-
type SelectionId$1 = string | number;
|
|
589
410
|
export interface UseSingleSelectionReturn {
|
|
590
|
-
selectedId: SelectionId
|
|
411
|
+
selectedId: SelectionId | undefined;
|
|
591
412
|
hasSelection: boolean;
|
|
592
|
-
select: (id: SelectionId
|
|
413
|
+
select: (id: SelectionId) => void;
|
|
593
414
|
deselect: () => void;
|
|
594
|
-
toggle: (id: SelectionId
|
|
595
|
-
isSelected: (id: SelectionId
|
|
415
|
+
toggle: (id: SelectionId) => void;
|
|
416
|
+
isSelected: (id: SelectionId) => boolean;
|
|
596
417
|
resetSelection: () => void;
|
|
597
418
|
}
|
|
598
|
-
export declare function useSingleSelection(initialSelectedId?: SelectionId
|
|
419
|
+
export declare function useSingleSelection(initialSelectedId?: SelectionId): UseSingleSelectionReturn;
|
|
599
420
|
export type SortType = "numeric" | "alphabetical" | "alphanumeric" | "boolean" | "date" | "basic" | "custom";
|
|
600
421
|
export interface BaseSortOptions {
|
|
601
422
|
desc?: boolean;
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as
|
|
3
|
-
import { n as
|
|
4
|
-
import { a as
|
|
5
|
-
import { a as
|
|
6
|
-
|
|
7
|
-
export { Nt as FuzzyHighlighter, Pt as ModalLayout, e as addBusinessDays, t as addDays, n as addHours, r as addMilliseconds, i as addMinutes, a as addMonths, o as addSeconds, s as addWeeks, c as addYears, l as clampDate, u as closestTo, d as createDate, f as differenceInBusinessDays, p as differenceInDays, m as differenceInHours, h as differenceInMilliseconds, g as differenceInMinutes, _ as differenceInMonths, v as differenceInSeconds, y as differenceInWeeks, b as differenceInYears, x as durationToMilliseconds, S as eachDayOfInterval, C as eachMonthOfInterval, w as eachYearOfInterval, T as endOfDay, E as endOfHour, D as endOfMinute, O as endOfMonth, k as endOfQuarter, A as endOfWeek, j as endOfYear, M as format, N as formatDate, P as formatDuration, F as formatISO, I as formatISO9075, L as formatRFC2822, R as formatRFC3339, z as formatRelativeTime, B as fromUnixTime, V as getDate, H as getDayOfWeek, U as getDayOfYear, W as getDaysInMonth, G as getHours, K as getISOWeek, q as getMilliseconds, J as getMinutes, Y as getMonth, X as getQuarter, Z as getSeconds, Q as getTimestamp, $ as getYear, ee as intervalToDuration, te as isAM, ne as isAfter, re as isBefore, ie as isDate, ae as isEqual, oe as isFirstDayOfMonth, se as isFuture, ce as isInLeapYear, le as isLastDayOfMonth, ue as isLeapYear, de as isOverlapping, fe as isPM, pe as isPast, me as isSameDay, he as isSameHour, ge as isSameMinute, _e as isSameMonth, ve as isSameQuarter, ye as isSameSecond, be as isSameTime, xe as isSameWeek, Se as isSameYear, Ce as isThisMonth, we as isThisWeek, Te as isThisYear, Ee as isToday, De as isTomorrow, Oe as isValid, ke as isWeekday, Ae as isWeekend, je as isWithinRange, Me as isYesterday, Ne as max, Pe as min, Fe as parseISO, Ie as roundToNearestMinutes, Le as setDate, Re as setHours, ze as setISOWeek, Be as setMilliseconds, Ve as setMinutes, He as setMonth, Ue as setSeconds, We as setYear, Ge as startOfDay, Ke as startOfHour, qe as startOfMinute, Je as startOfMonth, Ye as startOfQuarter, Xe as startOfWeek, Ze as startOfYear, Qe as subDays, $e as subHours, et as subMilliseconds, tt as subMinutes, nt as subMonths, rt as subSeconds, it as subWeeks, at as subYears, ot as toDate, st as toISOString, ct as toUnixTime, ut as useClickOutside, ht as useDebounce, mt as useDebouncedCallback, Ct as useDebouncedState, _t as useDebouncedValue, lt as useEventListener, Lt as useExpansion, Tt as useFilter, At as useFuzzySearch, Ot as useGrouping, dt as useKey, Mt as useModal, It as useModalActions, Rt as useModalState, wt as useMultipleSelection, Et as useOrder, kt as usePagination, Ft as usePin, pt as useRateLimit, xt as useRateLimitedCallback, Dt as useSingleSelection, jt as useSort, yt as useThrottle, ft as useThrottledCallback, gt as useThrottledState, bt as useThrottledValue, vt as useVirtualGrid, St as useVirtualList, zt as useVisibility };
|
|
1
|
+
import { t as e } from "./useEventListener.js";
|
|
2
|
+
import { n as t, t as n } from "./events2.js";
|
|
3
|
+
import { a as r, c as i, d as a, f as o, i as s, l as c, n as l, o as u, r as d, s as f, t as p, u as m } from "./performance2.js";
|
|
4
|
+
import { a as h, c as g, i as _, n as v, o as y, r as b, s as x, t as S } from "./state2.js";
|
|
5
|
+
import { a as C, c as w, i as T, n as E, o as D, r as O, s as k, t as A } from "./ui2.js";
|
|
6
|
+
export { w as FuzzyHighlighter, T as ModalLayout, t as useClickOutside, o as useDebounce, a as useDebouncedCallback, m as useDebouncedState, c as useDebouncedValue, e as useEventListener, O as useExpansion, g as useFilter, x as useFuzzySearch, y as useGrouping, n as useKey, C as useModal, D as useModalActions, k as useModalState, h as useMultipleSelection, _ as useOrder, b as usePagination, E as usePin, i as useRateLimit, f as useRateLimitedCallback, v as useSingleSelection, S as useSort, u as useThrottle, r as useThrottledCallback, s as useThrottledState, d as useThrottledValue, l as useVirtualGrid, p as useVirtualList, A as useVisibility };
|
package/dist/performance2.js
CHANGED
|
@@ -197,7 +197,7 @@ function _(e, t, n = {}) {
|
|
|
197
197
|
}, [e, o]), i;
|
|
198
198
|
}
|
|
199
199
|
//#endregion
|
|
200
|
-
//#region src/
|
|
200
|
+
//#region src/shared/virtualShared/offsetCache.ts
|
|
201
201
|
var v = class {
|
|
202
202
|
_offsets = /* @__PURE__ */ new Float64Array();
|
|
203
203
|
_count = 0;
|
|
@@ -266,7 +266,7 @@ var v = class {
|
|
|
266
266
|
}
|
|
267
267
|
};
|
|
268
268
|
//#endregion
|
|
269
|
-
//#region src/
|
|
269
|
+
//#region src/shared/virtualShared/utils.ts
|
|
270
270
|
function y(e, t) {
|
|
271
271
|
let n = typeof t == "function" ? t(e) : t, r = Number(n);
|
|
272
272
|
return Number.isFinite(r) && r >= 0 ? r : 0;
|
package/dist/state.d.ts
CHANGED
|
@@ -179,17 +179,16 @@ export interface UsePaginationReturn<T> {
|
|
|
179
179
|
resetPagination: () => void;
|
|
180
180
|
}
|
|
181
181
|
export declare function usePagination<T>(data: T[] | undefined, initialPageSize: number, initialPageIndex?: number): UsePaginationReturn<T>;
|
|
182
|
-
type SelectionId$1 = string | number;
|
|
183
182
|
export interface UseSingleSelectionReturn {
|
|
184
|
-
selectedId: SelectionId
|
|
183
|
+
selectedId: SelectionId | undefined;
|
|
185
184
|
hasSelection: boolean;
|
|
186
|
-
select: (id: SelectionId
|
|
185
|
+
select: (id: SelectionId) => void;
|
|
187
186
|
deselect: () => void;
|
|
188
|
-
toggle: (id: SelectionId
|
|
189
|
-
isSelected: (id: SelectionId
|
|
187
|
+
toggle: (id: SelectionId) => void;
|
|
188
|
+
isSelected: (id: SelectionId) => boolean;
|
|
190
189
|
resetSelection: () => void;
|
|
191
190
|
}
|
|
192
|
-
export declare function useSingleSelection(initialSelectedId?: SelectionId
|
|
191
|
+
export declare function useSingleSelection(initialSelectedId?: SelectionId): UseSingleSelectionReturn;
|
|
193
192
|
export type SortType = "numeric" | "alphabetical" | "alphanumeric" | "boolean" | "date" | "basic" | "custom";
|
|
194
193
|
export interface BaseSortOptions {
|
|
195
194
|
desc?: boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@himanshu-sorathiya/react-kit",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.24",
|
|
4
4
|
"description": "An opinionated collection of react hooks, and reusable UI components.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./dist/index.js",
|
|
@@ -29,15 +29,11 @@
|
|
|
29
29
|
"types": "./dist/events.d.ts",
|
|
30
30
|
"import": "./dist/events.js"
|
|
31
31
|
},
|
|
32
|
-
"./datetime": {
|
|
33
|
-
"types": "./dist/datetime.d.ts",
|
|
34
|
-
"import": "./dist/datetime.js"
|
|
35
|
-
},
|
|
36
32
|
"./styles.css": "./dist/index.css"
|
|
37
33
|
},
|
|
38
34
|
"scripts": {
|
|
39
35
|
"dev": "vite",
|
|
40
|
-
"build": "vite build && dts-bundle-generator --project tsconfig.app.json -o dist/index.d.ts src/index.ts && dts-bundle-generator --project tsconfig.app.json -o dist/ui.d.ts src/ui/index.ts && dts-bundle-generator --project tsconfig.app.json -o dist/state.d.ts src/state/index.ts && dts-bundle-generator --project tsconfig.app.json -o dist/performance.d.ts src/performance/index.ts && dts-bundle-generator --project tsconfig.app.json -o dist/events.d.ts src/events/index.ts
|
|
36
|
+
"build": "vite build && dts-bundle-generator --project tsconfig.app.json -o dist/index.d.ts src/index.ts && dts-bundle-generator --project tsconfig.app.json -o dist/ui.d.ts src/ui/index.ts && dts-bundle-generator --project tsconfig.app.json -o dist/state.d.ts src/state/index.ts && dts-bundle-generator --project tsconfig.app.json -o dist/performance.d.ts src/performance/index.ts && dts-bundle-generator --project tsconfig.app.json -o dist/events.d.ts src/events/index.ts",
|
|
41
37
|
"lint": "eslint .",
|
|
42
38
|
"preview": "vite preview",
|
|
43
39
|
"format": "prettier . --write"
|
package/dist/datetime.d.ts
DELETED
|
@@ -1,182 +0,0 @@
|
|
|
1
|
-
// Generated by dts-bundle-generator v9.5.1
|
|
2
|
-
|
|
3
|
-
export type DateInput = Date | number | string;
|
|
4
|
-
export type WeekStartsOn = 0 | 1 | 2 | 3 | 4 | 5 | 6;
|
|
5
|
-
export type DateInterval = {
|
|
6
|
-
start: Date;
|
|
7
|
-
end: Date;
|
|
8
|
-
};
|
|
9
|
-
export type DateRange = {
|
|
10
|
-
start: Date;
|
|
11
|
-
end: Date;
|
|
12
|
-
};
|
|
13
|
-
export type Duration = {
|
|
14
|
-
years?: number;
|
|
15
|
-
months?: number;
|
|
16
|
-
weeks?: number;
|
|
17
|
-
days?: number;
|
|
18
|
-
hours?: number;
|
|
19
|
-
minutes?: number;
|
|
20
|
-
seconds?: number;
|
|
21
|
-
};
|
|
22
|
-
export declare function toDate(input: DateInput): Date;
|
|
23
|
-
export declare function isDate(value: unknown): value is Date;
|
|
24
|
-
export declare function isValid(date: Date): boolean;
|
|
25
|
-
export declare function createDate(year: number, month: number, day?: number): Date;
|
|
26
|
-
export declare function getYear(date: DateInput): number;
|
|
27
|
-
export declare function getMonth(date: DateInput): number;
|
|
28
|
-
export declare function getDate(date: DateInput): number;
|
|
29
|
-
export declare function getHours(date: DateInput): number;
|
|
30
|
-
export declare function getMinutes(date: DateInput): number;
|
|
31
|
-
export declare function getSeconds(date: DateInput): number;
|
|
32
|
-
export declare function getMilliseconds(date: DateInput): number;
|
|
33
|
-
export declare function getTimestamp(date: DateInput): number;
|
|
34
|
-
export declare function getDayOfWeek(date: DateInput): number;
|
|
35
|
-
export declare function getDaysInMonth(date: DateInput): number;
|
|
36
|
-
export declare function getQuarter(date: DateInput): number;
|
|
37
|
-
export declare function getDayOfYear(date: DateInput): number;
|
|
38
|
-
declare const TOKEN_FORMATTERS: {
|
|
39
|
-
yyyy: (d: Date) => string;
|
|
40
|
-
yy: (d: Date) => string;
|
|
41
|
-
MMMM: (d: Date, loc: string) => string;
|
|
42
|
-
MMM: (d: Date, loc: string) => string;
|
|
43
|
-
MM: (d: Date) => string;
|
|
44
|
-
M: (d: Date) => string;
|
|
45
|
-
dd: (d: Date) => string;
|
|
46
|
-
d: (d: Date) => string;
|
|
47
|
-
EEEE: (d: Date, loc: string) => string;
|
|
48
|
-
EEE: (d: Date, loc: string) => string;
|
|
49
|
-
E: (d: Date, loc: string) => string;
|
|
50
|
-
HH: (d: Date) => string;
|
|
51
|
-
H: (d: Date) => string;
|
|
52
|
-
hh: (d: Date) => string;
|
|
53
|
-
h: (d: Date) => string;
|
|
54
|
-
mm: (d: Date) => string;
|
|
55
|
-
ss: (d: Date) => string;
|
|
56
|
-
SSS: (d: Date) => string;
|
|
57
|
-
a: (d: Date, loc: string) => string;
|
|
58
|
-
Q: (d: Date) => string;
|
|
59
|
-
w: (d: Date) => string;
|
|
60
|
-
D: (d: Date) => string;
|
|
61
|
-
xxx: (d: Date) => string;
|
|
62
|
-
xx: (d: Date) => string;
|
|
63
|
-
x: (d: Date) => string;
|
|
64
|
-
};
|
|
65
|
-
export type FormatToken = keyof typeof TOKEN_FORMATTERS;
|
|
66
|
-
export declare function format(date: DateInput, formatString: string, options?: {
|
|
67
|
-
locale?: string;
|
|
68
|
-
}): string;
|
|
69
|
-
export declare function formatDate(date: DateInput, locale?: string, options?: Intl.DateTimeFormatOptions): string;
|
|
70
|
-
export declare function formatRelativeTime(date: DateInput, baseDate?: DateInput, locale?: string): string;
|
|
71
|
-
export declare function formatISO(date: DateInput, options?: {
|
|
72
|
-
format?: "extended" | "basic";
|
|
73
|
-
representation?: "complete" | "date" | "time";
|
|
74
|
-
}): string;
|
|
75
|
-
export declare function formatRFC3339(date: DateInput, options?: {
|
|
76
|
-
fractionDigits?: 0 | 1 | 2 | 3;
|
|
77
|
-
}): string;
|
|
78
|
-
export declare function formatISO9075(date: DateInput, options?: {
|
|
79
|
-
representation?: "complete" | "date" | "time";
|
|
80
|
-
}): string;
|
|
81
|
-
export declare function formatRFC2822(date: DateInput): string;
|
|
82
|
-
export declare function formatDuration(duration: Duration, options?: {
|
|
83
|
-
format?: ReadonlyArray<keyof Duration>;
|
|
84
|
-
zero?: boolean;
|
|
85
|
-
delimiter?: string;
|
|
86
|
-
locale?: string;
|
|
87
|
-
}): string;
|
|
88
|
-
export declare function toISOString(date: DateInput): string;
|
|
89
|
-
export declare function parseISO(isoString: string): Date;
|
|
90
|
-
export declare function addMilliseconds(date: DateInput, amount: number): Date;
|
|
91
|
-
export declare function addSeconds(date: DateInput, amount: number): Date;
|
|
92
|
-
export declare function addMinutes(date: DateInput, amount: number): Date;
|
|
93
|
-
export declare function addHours(date: DateInput, amount: number): Date;
|
|
94
|
-
export declare function addDays(date: DateInput, amount: number): Date;
|
|
95
|
-
export declare function addWeeks(date: DateInput, amount: number): Date;
|
|
96
|
-
export declare function addMonths(date: DateInput, amount: number): Date;
|
|
97
|
-
export declare function addYears(date: DateInput, amount: number): Date;
|
|
98
|
-
export declare function subMilliseconds(date: DateInput, amount: number): Date;
|
|
99
|
-
export declare function subSeconds(date: DateInput, amount: number): Date;
|
|
100
|
-
export declare function subMinutes(date: DateInput, amount: number): Date;
|
|
101
|
-
export declare function subHours(date: DateInput, amount: number): Date;
|
|
102
|
-
export declare function subDays(date: DateInput, amount: number): Date;
|
|
103
|
-
export declare function subWeeks(date: DateInput, amount: number): Date;
|
|
104
|
-
export declare function subMonths(date: DateInput, amount: number): Date;
|
|
105
|
-
export declare function subYears(date: DateInput, amount: number): Date;
|
|
106
|
-
export declare function setYear(date: DateInput, year: number): Date;
|
|
107
|
-
export declare function setMonth(date: DateInput, month: number): Date;
|
|
108
|
-
export declare function setDate(date: DateInput, day: number): Date;
|
|
109
|
-
export declare function setHours(date: DateInput, hours: number): Date;
|
|
110
|
-
export declare function setMinutes(date: DateInput, minutes: number): Date;
|
|
111
|
-
export declare function setSeconds(date: DateInput, seconds: number): Date;
|
|
112
|
-
export declare function setMilliseconds(date: DateInput, ms: number): Date;
|
|
113
|
-
export declare function startOfDay(date: DateInput): Date;
|
|
114
|
-
export declare function endOfDay(date: DateInput): Date;
|
|
115
|
-
export declare function startOfHour(date: DateInput): Date;
|
|
116
|
-
export declare function endOfHour(date: DateInput): Date;
|
|
117
|
-
export declare function startOfMinute(date: DateInput): Date;
|
|
118
|
-
export declare function endOfMinute(date: DateInput): Date;
|
|
119
|
-
export declare function startOfWeek(date: DateInput, weekStartsOn?: WeekStartsOn): Date;
|
|
120
|
-
export declare function endOfWeek(date: DateInput, weekStartsOn?: WeekStartsOn): Date;
|
|
121
|
-
export declare function startOfMonth(date: DateInput): Date;
|
|
122
|
-
export declare function endOfMonth(date: DateInput): Date;
|
|
123
|
-
export declare function startOfQuarter(date: DateInput): Date;
|
|
124
|
-
export declare function endOfQuarter(date: DateInput): Date;
|
|
125
|
-
export declare function startOfYear(date: DateInput): Date;
|
|
126
|
-
export declare function endOfYear(date: DateInput): Date;
|
|
127
|
-
export declare function differenceInMilliseconds(dateLeft: DateInput, dateRight: DateInput): number;
|
|
128
|
-
export declare function differenceInSeconds(dateLeft: DateInput, dateRight: DateInput): number;
|
|
129
|
-
export declare function differenceInMinutes(dateLeft: DateInput, dateRight: DateInput): number;
|
|
130
|
-
export declare function differenceInHours(dateLeft: DateInput, dateRight: DateInput): number;
|
|
131
|
-
export declare function differenceInDays(dateLeft: DateInput, dateRight: DateInput): number;
|
|
132
|
-
export declare function differenceInWeeks(dateLeft: DateInput, dateRight: DateInput): number;
|
|
133
|
-
export declare function differenceInMonths(dateLeft: DateInput, dateRight: DateInput): number;
|
|
134
|
-
export declare function differenceInYears(dateLeft: DateInput, dateRight: DateInput): number;
|
|
135
|
-
export declare function addBusinessDays(date: DateInput, amount: number): Date;
|
|
136
|
-
export declare function differenceInBusinessDays(dateLeft: DateInput, dateRight: DateInput): number;
|
|
137
|
-
export declare function clampDate(date: DateInput, min: DateInput, max: DateInput): Date;
|
|
138
|
-
export declare function min(dates: Date[]): Date | null;
|
|
139
|
-
export declare function max(dates: Date[]): Date | null;
|
|
140
|
-
export declare function closestTo(date: DateInput, datesArray: Date[]): Date | null;
|
|
141
|
-
export declare function eachDayOfInterval(interval: DateInterval): Date[];
|
|
142
|
-
export declare function eachMonthOfInterval(interval: DateInterval): Date[];
|
|
143
|
-
export declare function eachYearOfInterval(interval: DateInterval): Date[];
|
|
144
|
-
export declare function fromUnixTime(seconds: number): Date;
|
|
145
|
-
export declare function toUnixTime(date: DateInput): number;
|
|
146
|
-
export declare function roundToNearestMinutes(date: DateInput, step: number): Date;
|
|
147
|
-
export declare function getISOWeek(date: DateInput): number;
|
|
148
|
-
export declare function setISOWeek(date: DateInput, week: number): Date;
|
|
149
|
-
export declare function intervalToDuration(interval: DateInterval): Duration;
|
|
150
|
-
export declare function durationToMilliseconds(duration: Duration): number;
|
|
151
|
-
export declare function isSameDay(dateA: DateInput, dateB: DateInput): boolean;
|
|
152
|
-
export declare function isSameMonth(dateA: DateInput, dateB: DateInput): boolean;
|
|
153
|
-
export declare function isSameYear(dateA: DateInput, dateB: DateInput): boolean;
|
|
154
|
-
export declare function isSameQuarter(dateA: DateInput, dateB: DateInput): boolean;
|
|
155
|
-
export declare function isSameWeek(dateA: DateInput, dateB: DateInput, weekStartsOn?: WeekStartsOn): boolean;
|
|
156
|
-
export declare function isSameHour(dateA: DateInput, dateB: DateInput): boolean;
|
|
157
|
-
export declare function isSameMinute(dateA: DateInput, dateB: DateInput): boolean;
|
|
158
|
-
export declare function isSameSecond(dateA: DateInput, dateB: DateInput): boolean;
|
|
159
|
-
export declare function isSameTime(dateA: DateInput, dateB: DateInput): boolean;
|
|
160
|
-
export declare function isBefore(date: DateInput, compareDate: DateInput): boolean;
|
|
161
|
-
export declare function isAfter(date: DateInput, compareDate: DateInput): boolean;
|
|
162
|
-
export declare function isEqual(dateA: DateInput, dateB: DateInput): boolean;
|
|
163
|
-
export declare function isWithinRange(date: DateInput, start: DateInput, end: DateInput): boolean;
|
|
164
|
-
export declare function isOverlapping(rangeA: DateRange, rangeB: DateRange): boolean;
|
|
165
|
-
export declare function isToday(date: DateInput): boolean;
|
|
166
|
-
export declare function isYesterday(date: DateInput): boolean;
|
|
167
|
-
export declare function isTomorrow(date: DateInput): boolean;
|
|
168
|
-
export declare function isPast(date: DateInput): boolean;
|
|
169
|
-
export declare function isFuture(date: DateInput): boolean;
|
|
170
|
-
export declare function isThisWeek(date: DateInput, weekStartsOn?: WeekStartsOn): boolean;
|
|
171
|
-
export declare function isThisMonth(date: DateInput): boolean;
|
|
172
|
-
export declare function isThisYear(date: DateInput): boolean;
|
|
173
|
-
export declare function isFirstDayOfMonth(date: DateInput): boolean;
|
|
174
|
-
export declare function isLastDayOfMonth(date: DateInput): boolean;
|
|
175
|
-
export declare function isWeekend(date: DateInput): boolean;
|
|
176
|
-
export declare function isWeekday(date: DateInput): boolean;
|
|
177
|
-
export declare function isAM(date: DateInput): boolean;
|
|
178
|
-
export declare function isPM(date: DateInput): boolean;
|
|
179
|
-
export declare function isLeapYear(yearOrDate: number | Date): boolean;
|
|
180
|
-
export declare function isInLeapYear(date: DateInput): boolean;
|
|
181
|
-
|
|
182
|
-
export {};
|
package/dist/datetime.js
DELETED
|
@@ -1,594 +0,0 @@
|
|
|
1
|
-
//#region src/datetime/core.ts
|
|
2
|
-
function e(e) {
|
|
3
|
-
return e instanceof Date ? new Date(e.getTime()) : typeof e != "number" && typeof e != "string" ? /* @__PURE__ */ new Date(NaN) : new Date(e);
|
|
4
|
-
}
|
|
5
|
-
function t(e) {
|
|
6
|
-
return e instanceof Date;
|
|
7
|
-
}
|
|
8
|
-
function n(e) {
|
|
9
|
-
return t(e) && !isNaN(e.getTime());
|
|
10
|
-
}
|
|
11
|
-
function r(e, t, n = 1) {
|
|
12
|
-
let r = new Date(e, t - 1, n);
|
|
13
|
-
return r.getMonth() === t - 1 ? r : new Date(e, t, 0);
|
|
14
|
-
}
|
|
15
|
-
function i(t) {
|
|
16
|
-
return e(t).getFullYear();
|
|
17
|
-
}
|
|
18
|
-
function a(t) {
|
|
19
|
-
return e(t).getMonth() + 1;
|
|
20
|
-
}
|
|
21
|
-
function o(t) {
|
|
22
|
-
return e(t).getDate();
|
|
23
|
-
}
|
|
24
|
-
function s(t) {
|
|
25
|
-
return e(t).getHours();
|
|
26
|
-
}
|
|
27
|
-
function c(t) {
|
|
28
|
-
return e(t).getMinutes();
|
|
29
|
-
}
|
|
30
|
-
function l(t) {
|
|
31
|
-
return e(t).getSeconds();
|
|
32
|
-
}
|
|
33
|
-
function u(t) {
|
|
34
|
-
return e(t).getMilliseconds();
|
|
35
|
-
}
|
|
36
|
-
function d(t) {
|
|
37
|
-
return e(t).getTime();
|
|
38
|
-
}
|
|
39
|
-
function f(t) {
|
|
40
|
-
return e(t).getDay();
|
|
41
|
-
}
|
|
42
|
-
function p(t) {
|
|
43
|
-
let n = e(t);
|
|
44
|
-
return new Date(n.getFullYear(), n.getMonth() + 1, 0).getDate();
|
|
45
|
-
}
|
|
46
|
-
function m(t) {
|
|
47
|
-
return Math.ceil((e(t).getMonth() + 1) / 3);
|
|
48
|
-
}
|
|
49
|
-
function h(t) {
|
|
50
|
-
let n = e(t), r = new Date(n.getFullYear(), 0, 1, 0, 0, 0, 0), i = new Date(n.getFullYear(), n.getMonth(), n.getDate(), 0, 0, 0, 0);
|
|
51
|
-
return Math.round((i.getTime() - r.getTime()) / 864e5) + 1;
|
|
52
|
-
}
|
|
53
|
-
//#endregion
|
|
54
|
-
//#region src/datetime/manipulation.ts
|
|
55
|
-
var g = 1e3, _ = 6e4, v = 36e5, y = 864e5;
|
|
56
|
-
function b(t, n) {
|
|
57
|
-
return new Date(e(t).getTime() + n);
|
|
58
|
-
}
|
|
59
|
-
function x(t, n) {
|
|
60
|
-
return new Date(e(t).getTime() + n * g);
|
|
61
|
-
}
|
|
62
|
-
function S(t, n) {
|
|
63
|
-
return new Date(e(t).getTime() + n * _);
|
|
64
|
-
}
|
|
65
|
-
function C(t, n) {
|
|
66
|
-
return new Date(e(t).getTime() + n * v);
|
|
67
|
-
}
|
|
68
|
-
function w(t, n) {
|
|
69
|
-
let r = e(t);
|
|
70
|
-
return r.setDate(r.getDate() + n), r;
|
|
71
|
-
}
|
|
72
|
-
function T(e, t) {
|
|
73
|
-
return w(e, t * 7);
|
|
74
|
-
}
|
|
75
|
-
function E(t, n) {
|
|
76
|
-
let r = e(t), i = r.getDate();
|
|
77
|
-
return r.setDate(1), r.setMonth(r.getMonth() + n), r.setDate(Math.min(i, p(r))), r;
|
|
78
|
-
}
|
|
79
|
-
function D(t, n) {
|
|
80
|
-
let r = e(t), i = r.getMonth();
|
|
81
|
-
return r.setFullYear(r.getFullYear() + n), r.getMonth() !== i && r.setDate(0), r;
|
|
82
|
-
}
|
|
83
|
-
function ee(e, t) {
|
|
84
|
-
return b(e, -t);
|
|
85
|
-
}
|
|
86
|
-
function te(e, t) {
|
|
87
|
-
return x(e, -t);
|
|
88
|
-
}
|
|
89
|
-
function O(e, t) {
|
|
90
|
-
return S(e, -t);
|
|
91
|
-
}
|
|
92
|
-
function ne(e, t) {
|
|
93
|
-
return C(e, -t);
|
|
94
|
-
}
|
|
95
|
-
function re(e, t) {
|
|
96
|
-
return w(e, -t);
|
|
97
|
-
}
|
|
98
|
-
function ie(e, t) {
|
|
99
|
-
return T(e, -t);
|
|
100
|
-
}
|
|
101
|
-
function ae(e, t) {
|
|
102
|
-
return E(e, -t);
|
|
103
|
-
}
|
|
104
|
-
function oe(e, t) {
|
|
105
|
-
return D(e, -t);
|
|
106
|
-
}
|
|
107
|
-
function se(t, n) {
|
|
108
|
-
let r = e(t), i = r.getMonth();
|
|
109
|
-
return r.setFullYear(n), r.getMonth() !== i && r.setDate(0), r;
|
|
110
|
-
}
|
|
111
|
-
function ce(t, n) {
|
|
112
|
-
let r = e(t), i = r.getDate();
|
|
113
|
-
return r.setDate(1), r.setMonth(n - 1), r.setDate(Math.min(i, p(r))), r;
|
|
114
|
-
}
|
|
115
|
-
function le(t, n) {
|
|
116
|
-
let r = e(t), i = p(r);
|
|
117
|
-
return r.setDate(Math.min(Math.max(1, n), i)), r;
|
|
118
|
-
}
|
|
119
|
-
function ue(t, n) {
|
|
120
|
-
let r = e(t);
|
|
121
|
-
return r.setHours(n), r;
|
|
122
|
-
}
|
|
123
|
-
function de(t, n) {
|
|
124
|
-
let r = e(t);
|
|
125
|
-
return r.setMinutes(n), r;
|
|
126
|
-
}
|
|
127
|
-
function fe(t, n) {
|
|
128
|
-
let r = e(t);
|
|
129
|
-
return r.setSeconds(n), r;
|
|
130
|
-
}
|
|
131
|
-
function pe(t, n) {
|
|
132
|
-
let r = e(t);
|
|
133
|
-
return r.setMilliseconds(n), r;
|
|
134
|
-
}
|
|
135
|
-
function k(t) {
|
|
136
|
-
let n = e(t);
|
|
137
|
-
return n.setHours(0, 0, 0, 0), n;
|
|
138
|
-
}
|
|
139
|
-
function me(t) {
|
|
140
|
-
let n = e(t);
|
|
141
|
-
return n.setHours(23, 59, 59, 999), n;
|
|
142
|
-
}
|
|
143
|
-
function he(t) {
|
|
144
|
-
let n = e(t);
|
|
145
|
-
return n.setMinutes(0, 0, 0), n;
|
|
146
|
-
}
|
|
147
|
-
function ge(t) {
|
|
148
|
-
let n = e(t);
|
|
149
|
-
return n.setMinutes(59, 59, 999), n;
|
|
150
|
-
}
|
|
151
|
-
function _e(t) {
|
|
152
|
-
let n = e(t);
|
|
153
|
-
return n.setSeconds(0, 0), n;
|
|
154
|
-
}
|
|
155
|
-
function ve(t) {
|
|
156
|
-
let n = e(t);
|
|
157
|
-
return n.setSeconds(59, 999), n;
|
|
158
|
-
}
|
|
159
|
-
function A(t, n = 0) {
|
|
160
|
-
let r = e(t), i = (r.getDay() - n + 7) % 7;
|
|
161
|
-
return r.setDate(r.getDate() - i), r.setHours(0, 0, 0, 0), r;
|
|
162
|
-
}
|
|
163
|
-
function j(e, t = 0) {
|
|
164
|
-
let n = A(e, t);
|
|
165
|
-
return n.setDate(n.getDate() + 6), n.setHours(23, 59, 59, 999), n;
|
|
166
|
-
}
|
|
167
|
-
function M(t) {
|
|
168
|
-
let n = e(t);
|
|
169
|
-
return n.setDate(1), n.setHours(0, 0, 0, 0), n;
|
|
170
|
-
}
|
|
171
|
-
function N(t) {
|
|
172
|
-
let n = e(t);
|
|
173
|
-
return new Date(n.getFullYear(), n.getMonth() + 1, 0, 23, 59, 59, 999);
|
|
174
|
-
}
|
|
175
|
-
function P(t) {
|
|
176
|
-
let n = e(t), r = n.getMonth() - n.getMonth() % 3;
|
|
177
|
-
return new Date(n.getFullYear(), r, 1, 0, 0, 0, 0);
|
|
178
|
-
}
|
|
179
|
-
function F(t) {
|
|
180
|
-
let n = e(t), r = n.getMonth() - n.getMonth() % 3 + 2;
|
|
181
|
-
return new Date(n.getFullYear(), r + 1, 0, 23, 59, 59, 999);
|
|
182
|
-
}
|
|
183
|
-
function I(t) {
|
|
184
|
-
let n = e(t);
|
|
185
|
-
return new Date(n.getFullYear(), 0, 1, 0, 0, 0, 0);
|
|
186
|
-
}
|
|
187
|
-
function ye(t) {
|
|
188
|
-
let n = e(t);
|
|
189
|
-
return new Date(n.getFullYear(), 11, 31, 23, 59, 59, 999);
|
|
190
|
-
}
|
|
191
|
-
function L(t, n) {
|
|
192
|
-
return e(t).getTime() - e(n).getTime();
|
|
193
|
-
}
|
|
194
|
-
function R(e, t) {
|
|
195
|
-
return Math.trunc(L(e, t) / g);
|
|
196
|
-
}
|
|
197
|
-
function z(e, t) {
|
|
198
|
-
return Math.trunc(L(e, t) / _);
|
|
199
|
-
}
|
|
200
|
-
function B(e, t) {
|
|
201
|
-
return Math.trunc(L(e, t) / v);
|
|
202
|
-
}
|
|
203
|
-
function V(t, n) {
|
|
204
|
-
let r = k(e(t)), i = k(e(n));
|
|
205
|
-
return Math.round((r.getTime() - i.getTime()) / y);
|
|
206
|
-
}
|
|
207
|
-
function be(e, t) {
|
|
208
|
-
return Math.trunc(V(e, t) / 7);
|
|
209
|
-
}
|
|
210
|
-
function H(t, n) {
|
|
211
|
-
let r = e(t), i = e(n), a = r.getFullYear() - i.getFullYear(), o = r.getMonth() - i.getMonth(), s = a * 12 + o, c = E(i, s);
|
|
212
|
-
return s > 0 && c.getTime() > r.getTime() ? s - 1 : s < 0 && c.getTime() < r.getTime() ? s + 1 : s;
|
|
213
|
-
}
|
|
214
|
-
function U(t, n) {
|
|
215
|
-
let r = e(t), i = e(n), a = r.getFullYear() - i.getFullYear(), o = D(i, a);
|
|
216
|
-
return a > 0 && o.getTime() > r.getTime() ? a - 1 : a < 0 && o.getTime() < r.getTime() ? a + 1 : a;
|
|
217
|
-
}
|
|
218
|
-
function xe(t, n) {
|
|
219
|
-
let r = e(t), i = n < 0 ? -1 : 1, a = Math.abs(n);
|
|
220
|
-
for (; a > 0;) {
|
|
221
|
-
r.setDate(r.getDate() + i);
|
|
222
|
-
let e = r.getDay();
|
|
223
|
-
e !== 0 && e !== 6 && a--;
|
|
224
|
-
}
|
|
225
|
-
return r;
|
|
226
|
-
}
|
|
227
|
-
function Se(t, n) {
|
|
228
|
-
let r = k(e(t)), i = k(e(n)), a = V(r, i);
|
|
229
|
-
if (a === 0) return 0;
|
|
230
|
-
let o = a > 0 ? 1 : -1, s = Math.abs(a), c = Math.floor(s / 7) * 5, l = new Date(i);
|
|
231
|
-
for (let e = 0; e < s % 7; e++) {
|
|
232
|
-
l.setDate(l.getDate() + o);
|
|
233
|
-
let e = l.getDay();
|
|
234
|
-
e !== 0 && e !== 6 && c++;
|
|
235
|
-
}
|
|
236
|
-
return c * o;
|
|
237
|
-
}
|
|
238
|
-
function Ce(t, r, i) {
|
|
239
|
-
let a = e(t), o = e(r), s = e(i);
|
|
240
|
-
return !n(a) || !n(o) || !n(s) ? /* @__PURE__ */ new Date(NaN) : a.getTime() < o.getTime() ? o : a.getTime() > s.getTime() ? s : a;
|
|
241
|
-
}
|
|
242
|
-
function we(e) {
|
|
243
|
-
return e.length === 0 ? null : new Date(Math.min(...e.map((e) => e.getTime())));
|
|
244
|
-
}
|
|
245
|
-
function Te(e) {
|
|
246
|
-
return e.length === 0 ? null : new Date(Math.max(...e.map((e) => e.getTime())));
|
|
247
|
-
}
|
|
248
|
-
function Ee(t, r) {
|
|
249
|
-
if (r.length === 0) return null;
|
|
250
|
-
let i = e(t);
|
|
251
|
-
if (!n(i)) return /* @__PURE__ */ new Date(NaN);
|
|
252
|
-
let a = i.getTime();
|
|
253
|
-
return r.reduce((e, t) => n(t) && Math.abs(t.getTime() - a) < Math.abs(e.getTime() - a) ? t : e);
|
|
254
|
-
}
|
|
255
|
-
function De(t) {
|
|
256
|
-
let n = [], r = k(e(t.start)), i = k(e(t.end)), a = new Date(r);
|
|
257
|
-
for (; a.getTime() <= i.getTime();) n.push(new Date(a)), a.setDate(a.getDate() + 1);
|
|
258
|
-
return n;
|
|
259
|
-
}
|
|
260
|
-
function Oe(t) {
|
|
261
|
-
let n = [], r = M(e(t.start)), i = M(e(t.end)), a = new Date(r);
|
|
262
|
-
for (; a.getTime() <= i.getTime();) n.push(new Date(a)), a.setMonth(a.getMonth() + 1);
|
|
263
|
-
return n;
|
|
264
|
-
}
|
|
265
|
-
function ke(t) {
|
|
266
|
-
let n = [], r = I(e(t.start)), i = I(e(t.end)), a = new Date(r);
|
|
267
|
-
for (; a.getTime() <= i.getTime();) n.push(new Date(a)), a.setFullYear(a.getFullYear() + 1);
|
|
268
|
-
return n;
|
|
269
|
-
}
|
|
270
|
-
function Ae(e) {
|
|
271
|
-
return /* @__PURE__ */ new Date(e * 1e3);
|
|
272
|
-
}
|
|
273
|
-
function je(t) {
|
|
274
|
-
return Math.floor(e(t).getTime() / 1e3);
|
|
275
|
-
}
|
|
276
|
-
function Me(t, n) {
|
|
277
|
-
let r = n * _;
|
|
278
|
-
return new Date(Math.round(e(t).getTime() / r) * r);
|
|
279
|
-
}
|
|
280
|
-
function W(t) {
|
|
281
|
-
let n = e(t), r = n.getDay() || 7;
|
|
282
|
-
n.setDate(n.getDate() + 4 - r);
|
|
283
|
-
let i = new Date(n.getFullYear(), 0, 1);
|
|
284
|
-
return Math.ceil(((n.getTime() - i.getTime()) / y + 1) / 7);
|
|
285
|
-
}
|
|
286
|
-
function Ne(t, n) {
|
|
287
|
-
let r = e(t), i = W(r);
|
|
288
|
-
return r.setDate(r.getDate() + (n - i) * 7), r;
|
|
289
|
-
}
|
|
290
|
-
function Pe(t) {
|
|
291
|
-
let n = e(t.start), r = e(t.end), [i, a] = n.getTime() <= r.getTime() ? [n, r] : [r, n], o = U(a, i), s = D(i, o), c = H(a, s), l = E(s, c), u = V(a, l), d = w(l, u), f = B(a, d), p = C(d, f), m = z(a, p);
|
|
292
|
-
return {
|
|
293
|
-
years: o,
|
|
294
|
-
months: c,
|
|
295
|
-
days: u,
|
|
296
|
-
hours: f,
|
|
297
|
-
minutes: m,
|
|
298
|
-
seconds: R(a, S(p, m))
|
|
299
|
-
};
|
|
300
|
-
}
|
|
301
|
-
function Fe(e) {
|
|
302
|
-
return (e.years ?? 0) * 315576e5 + (e.months ?? 0) * 26298e5 + (e.weeks ?? 0) * 7 * y + (e.days ?? 0) * y + (e.hours ?? 0) * v + (e.minutes ?? 0) * _ + (e.seconds ?? 0) * g;
|
|
303
|
-
}
|
|
304
|
-
//#endregion
|
|
305
|
-
//#region src/datetime/format.ts
|
|
306
|
-
function G(e) {
|
|
307
|
-
let t = e.getTimezoneOffset(), n = t <= 0 ? "+" : "-", r = Math.abs(t);
|
|
308
|
-
return {
|
|
309
|
-
sign: n,
|
|
310
|
-
hours: String(Math.floor(r / 60)).padStart(2, "0"),
|
|
311
|
-
minutes: String(r % 60).padStart(2, "0")
|
|
312
|
-
};
|
|
313
|
-
}
|
|
314
|
-
var K = {
|
|
315
|
-
yyyy: (e) => String(e.getFullYear()).padStart(4, "0"),
|
|
316
|
-
yy: (e) => String(e.getFullYear()).slice(-2),
|
|
317
|
-
MMMM: (e, t) => new Intl.DateTimeFormat(t, { month: "long" }).format(e),
|
|
318
|
-
MMM: (e, t) => new Intl.DateTimeFormat(t, { month: "short" }).format(e),
|
|
319
|
-
MM: (e) => String(e.getMonth() + 1).padStart(2, "0"),
|
|
320
|
-
M: (e) => String(e.getMonth() + 1),
|
|
321
|
-
dd: (e) => String(e.getDate()).padStart(2, "0"),
|
|
322
|
-
d: (e) => String(e.getDate()),
|
|
323
|
-
EEEE: (e, t) => new Intl.DateTimeFormat(t, { weekday: "long" }).format(e),
|
|
324
|
-
EEE: (e, t) => new Intl.DateTimeFormat(t, { weekday: "short" }).format(e),
|
|
325
|
-
E: (e, t) => new Intl.DateTimeFormat(t, { weekday: "short" }).format(e),
|
|
326
|
-
HH: (e) => String(e.getHours()).padStart(2, "0"),
|
|
327
|
-
H: (e) => String(e.getHours()),
|
|
328
|
-
hh: (e) => String(e.getHours() % 12 || 12).padStart(2, "0"),
|
|
329
|
-
h: (e) => String(e.getHours() % 12 || 12),
|
|
330
|
-
mm: (e) => String(e.getMinutes()).padStart(2, "0"),
|
|
331
|
-
ss: (e) => String(e.getSeconds()).padStart(2, "0"),
|
|
332
|
-
SSS: (e) => String(e.getMilliseconds()).padStart(3, "0"),
|
|
333
|
-
a: (e, t) => new Intl.DateTimeFormat(t, {
|
|
334
|
-
hour: "numeric",
|
|
335
|
-
hour12: !0
|
|
336
|
-
}).formatToParts(e).find((e) => e.type === "dayPeriod")?.value ?? "",
|
|
337
|
-
Q: (e) => String(Math.ceil((e.getMonth() + 1) / 3)),
|
|
338
|
-
w: (e) => String(W(e)),
|
|
339
|
-
D: (e) => String(h(e)),
|
|
340
|
-
xxx: (e) => {
|
|
341
|
-
let t = G(e);
|
|
342
|
-
return `${t.sign}${t.hours}:${t.minutes}`;
|
|
343
|
-
},
|
|
344
|
-
xx: (e) => {
|
|
345
|
-
let t = G(e);
|
|
346
|
-
return `${t.sign}${t.hours}${t.minutes}`;
|
|
347
|
-
},
|
|
348
|
-
x: (e) => {
|
|
349
|
-
let t = G(e);
|
|
350
|
-
return `${t.sign}${t.hours}`;
|
|
351
|
-
}
|
|
352
|
-
}, Ie = RegExp("'[^']*'|" + Object.keys(K).sort((e, t) => t.length - e.length).join("|"), "g");
|
|
353
|
-
function Le(t, r, i) {
|
|
354
|
-
let a = e(t);
|
|
355
|
-
if (!n(a)) return "Invalid Date";
|
|
356
|
-
let o = i?.locale ?? "default";
|
|
357
|
-
return r.replace(Ie, (e) => {
|
|
358
|
-
if (e.startsWith("'")) {
|
|
359
|
-
let t = e.slice(1, -1);
|
|
360
|
-
return t === "" ? "'" : t;
|
|
361
|
-
}
|
|
362
|
-
let t = K[e];
|
|
363
|
-
return t(a, o);
|
|
364
|
-
});
|
|
365
|
-
}
|
|
366
|
-
function Re(t, r = "default", i = {}) {
|
|
367
|
-
let a = e(t);
|
|
368
|
-
return n(a) ? new Intl.DateTimeFormat(r, i).format(a) : "Invalid Date";
|
|
369
|
-
}
|
|
370
|
-
function ze(t, r = /* @__PURE__ */ new Date(), i = "default") {
|
|
371
|
-
let a = e(t), o = e(r);
|
|
372
|
-
if (!n(a) || !n(o)) return "Invalid Date";
|
|
373
|
-
let s = new Intl.RelativeTimeFormat(i, { numeric: "auto" }), c = Math.abs.bind(Math), l = R(a, o), u = z(a, o), d = B(a, o), f = V(a, o), p = Math.trunc(f / 7), m = Math.round(f / 30.4375), h = Math.round(f / 365.25);
|
|
374
|
-
return c(l) < 60 ? s.format(l, "second") : c(u) < 60 ? s.format(u, "minute") : c(d) < 24 ? s.format(d, "hour") : c(f) < 7 ? s.format(f, "day") : c(p) < 4 ? s.format(p, "week") : c(m) < 12 ? s.format(m, "month") : s.format(h, "year");
|
|
375
|
-
}
|
|
376
|
-
function Be(t, r) {
|
|
377
|
-
let i = e(t);
|
|
378
|
-
if (!n(i)) return "Invalid Date";
|
|
379
|
-
let a = r?.format ?? "extended", o = r?.representation ?? "complete", s = a === "extended" ? "-" : "", c = a === "extended" ? ":" : "", l = String(i.getFullYear()).padStart(4, "0"), u = String(i.getMonth() + 1).padStart(2, "0"), d = String(i.getDate()).padStart(2, "0"), f = String(i.getHours()).padStart(2, "0"), p = String(i.getMinutes()).padStart(2, "0"), m = String(i.getSeconds()).padStart(2, "0"), h = G(i), g = `${h.sign}${h.hours}${c}${h.minutes}`, _ = `${l}${s}${u}${s}${d}`, v = `${f}${c}${p}${c}${m}`;
|
|
380
|
-
return o === "date" ? _ : o === "time" ? `${v}${g}` : `${_}T${v}${g}`;
|
|
381
|
-
}
|
|
382
|
-
function Ve(t, r) {
|
|
383
|
-
let i = e(t);
|
|
384
|
-
if (!n(i)) return "Invalid Date";
|
|
385
|
-
let a = r?.fractionDigits ?? 0;
|
|
386
|
-
return `${String(i.getFullYear()).padStart(4, "0")}-${String(i.getMonth() + 1).padStart(2, "0")}-${String(i.getDate()).padStart(2, "0")}T${String(i.getHours()).padStart(2, "0")}:${String(i.getMinutes()).padStart(2, "0")}:${String(i.getSeconds()).padStart(2, "0")}${a > 0 ? "." + String(i.getMilliseconds()).padStart(3, "0").slice(0, a) : ""}${i.getTimezoneOffset() === 0 ? "Z" : (() => {
|
|
387
|
-
let e = G(i);
|
|
388
|
-
return `${e.sign}${e.hours}:${e.minutes}`;
|
|
389
|
-
})()}`;
|
|
390
|
-
}
|
|
391
|
-
function He(t, r) {
|
|
392
|
-
let i = e(t);
|
|
393
|
-
if (!n(i)) return "Invalid Date";
|
|
394
|
-
let a = r?.representation ?? "complete", o = String(i.getFullYear()).padStart(4, "0"), s = String(i.getMonth() + 1).padStart(2, "0"), c = String(i.getDate()).padStart(2, "0"), l = String(i.getHours()).padStart(2, "0"), u = String(i.getMinutes()).padStart(2, "0"), d = String(i.getSeconds()).padStart(2, "0");
|
|
395
|
-
return a === "date" ? `${o}-${s}-${c}` : a === "time" ? `${l}:${u}:${d}` : `${o}-${s}-${c} ${l}:${u}:${d}`;
|
|
396
|
-
}
|
|
397
|
-
var Ue = [
|
|
398
|
-
"Sun",
|
|
399
|
-
"Mon",
|
|
400
|
-
"Tue",
|
|
401
|
-
"Wed",
|
|
402
|
-
"Thu",
|
|
403
|
-
"Fri",
|
|
404
|
-
"Sat"
|
|
405
|
-
], We = [
|
|
406
|
-
"Jan",
|
|
407
|
-
"Feb",
|
|
408
|
-
"Mar",
|
|
409
|
-
"Apr",
|
|
410
|
-
"May",
|
|
411
|
-
"Jun",
|
|
412
|
-
"Jul",
|
|
413
|
-
"Aug",
|
|
414
|
-
"Sep",
|
|
415
|
-
"Oct",
|
|
416
|
-
"Nov",
|
|
417
|
-
"Dec"
|
|
418
|
-
];
|
|
419
|
-
function Ge(t) {
|
|
420
|
-
let r = e(t);
|
|
421
|
-
if (!n(r)) return "Invalid Date";
|
|
422
|
-
let i = Ue[r.getDay()], a = String(r.getDate()).padStart(2, "0"), o = We[r.getMonth()], s = r.getFullYear(), c = String(r.getHours()).padStart(2, "0"), l = String(r.getMinutes()).padStart(2, "0"), u = String(r.getSeconds()).padStart(2, "0"), d = G(r);
|
|
423
|
-
return `${i}, ${a} ${o} ${s} ${c}:${l}:${u} ${d.sign}${d.hours}${d.minutes}`;
|
|
424
|
-
}
|
|
425
|
-
var Ke = [
|
|
426
|
-
"years",
|
|
427
|
-
"months",
|
|
428
|
-
"weeks",
|
|
429
|
-
"days",
|
|
430
|
-
"hours",
|
|
431
|
-
"minutes",
|
|
432
|
-
"seconds"
|
|
433
|
-
], qe = {
|
|
434
|
-
years: ["year", "years"],
|
|
435
|
-
months: ["month", "months"],
|
|
436
|
-
weeks: ["week", "weeks"],
|
|
437
|
-
days: ["day", "days"],
|
|
438
|
-
hours: ["hour", "hours"],
|
|
439
|
-
minutes: ["minute", "minutes"],
|
|
440
|
-
seconds: ["second", "seconds"]
|
|
441
|
-
};
|
|
442
|
-
function Je(e, t) {
|
|
443
|
-
let n = t?.zero ?? !1, r = t?.delimiter ?? ", ", i = t?.locale ?? "default", a = t?.format ?? Ke, o = new Intl.PluralRules(i), s = new Intl.NumberFormat(i), c = [];
|
|
444
|
-
for (let t of a) {
|
|
445
|
-
let r = e[t] ?? 0;
|
|
446
|
-
if (r === 0 && !n) continue;
|
|
447
|
-
let [i, a] = qe[t], l = o.select(r) === "one" ? i : a;
|
|
448
|
-
c.push(`${s.format(r)} ${l}`);
|
|
449
|
-
}
|
|
450
|
-
return c.join(r);
|
|
451
|
-
}
|
|
452
|
-
function Ye(t) {
|
|
453
|
-
let r = e(t);
|
|
454
|
-
return n(r) ? r.toISOString() : "Invalid Date";
|
|
455
|
-
}
|
|
456
|
-
var Xe = /^\d{4}-\d{2}-\d{2}(T\d{2}:\d{2}(:\d{2}(\.\d+)?)?(Z|[+-]\d{2}:?\d{2})?)?$/;
|
|
457
|
-
function Ze(e) {
|
|
458
|
-
return Xe.test(e.trim()) ? new Date(e) : /* @__PURE__ */ new Date(NaN);
|
|
459
|
-
}
|
|
460
|
-
//#endregion
|
|
461
|
-
//#region src/datetime/queries.ts
|
|
462
|
-
function q(e, t) {
|
|
463
|
-
let n = new Date(e), r = (n.getDay() - t + 7) % 7;
|
|
464
|
-
return n.setDate(n.getDate() - r), n.setHours(0, 0, 0, 0), n;
|
|
465
|
-
}
|
|
466
|
-
function J(t, r) {
|
|
467
|
-
let i = e(t), a = e(r);
|
|
468
|
-
return !n(i) || !n(a) ? !1 : i.getFullYear() === a.getFullYear() && i.getMonth() === a.getMonth() && i.getDate() === a.getDate();
|
|
469
|
-
}
|
|
470
|
-
function Y(t, r) {
|
|
471
|
-
let i = e(t), a = e(r);
|
|
472
|
-
return !n(i) || !n(a) ? !1 : i.getFullYear() === a.getFullYear() && i.getMonth() === a.getMonth();
|
|
473
|
-
}
|
|
474
|
-
function X(t, r) {
|
|
475
|
-
let i = e(t), a = e(r);
|
|
476
|
-
return !n(i) || !n(a) ? !1 : i.getFullYear() === a.getFullYear();
|
|
477
|
-
}
|
|
478
|
-
function Qe(t, r) {
|
|
479
|
-
let i = e(t), a = e(r);
|
|
480
|
-
if (!n(i) || !n(a)) return !1;
|
|
481
|
-
let o = Math.ceil((i.getMonth() + 1) / 3), s = Math.ceil((a.getMonth() + 1) / 3);
|
|
482
|
-
return i.getFullYear() === a.getFullYear() && o === s;
|
|
483
|
-
}
|
|
484
|
-
function Z(t, r, i = 0) {
|
|
485
|
-
let a = e(t), o = e(r);
|
|
486
|
-
return !n(a) || !n(o) ? !1 : q(a, i).getTime() === q(o, i).getTime();
|
|
487
|
-
}
|
|
488
|
-
function $e(t, r) {
|
|
489
|
-
let i = e(t), a = e(r);
|
|
490
|
-
return !n(i) || !n(a) ? !1 : i.getFullYear() === a.getFullYear() && i.getMonth() === a.getMonth() && i.getDate() === a.getDate() && i.getHours() === a.getHours();
|
|
491
|
-
}
|
|
492
|
-
function et(t, r) {
|
|
493
|
-
let i = e(t), a = e(r);
|
|
494
|
-
return !n(i) || !n(a) ? !1 : i.getFullYear() === a.getFullYear() && i.getMonth() === a.getMonth() && i.getDate() === a.getDate() && i.getHours() === a.getHours() && i.getMinutes() === a.getMinutes();
|
|
495
|
-
}
|
|
496
|
-
function tt(t, r) {
|
|
497
|
-
let i = e(t), a = e(r);
|
|
498
|
-
return !n(i) || !n(a) ? !1 : i.getFullYear() === a.getFullYear() && i.getMonth() === a.getMonth() && i.getDate() === a.getDate() && i.getHours() === a.getHours() && i.getMinutes() === a.getMinutes() && i.getSeconds() === a.getSeconds();
|
|
499
|
-
}
|
|
500
|
-
function nt(t, r) {
|
|
501
|
-
let i = e(t), a = e(r);
|
|
502
|
-
return !n(i) || !n(a) ? !1 : i.getHours() === a.getHours() && i.getMinutes() === a.getMinutes() && i.getSeconds() === a.getSeconds();
|
|
503
|
-
}
|
|
504
|
-
function rt(t, r) {
|
|
505
|
-
let i = e(t), a = e(r);
|
|
506
|
-
return !n(i) || !n(a) ? !1 : i.getTime() < a.getTime();
|
|
507
|
-
}
|
|
508
|
-
function it(t, r) {
|
|
509
|
-
let i = e(t), a = e(r);
|
|
510
|
-
return !n(i) || !n(a) ? !1 : i.getTime() > a.getTime();
|
|
511
|
-
}
|
|
512
|
-
function at(t, r) {
|
|
513
|
-
let i = e(t), a = e(r);
|
|
514
|
-
return !n(i) || !n(a) ? !1 : i.getTime() === a.getTime();
|
|
515
|
-
}
|
|
516
|
-
function ot(t, r, i) {
|
|
517
|
-
let a = e(t), o = e(r), s = e(i);
|
|
518
|
-
return !n(a) || !n(o) || !n(s) ? !1 : (o.getTime() > s.getTime() && ([o, s] = [s, o]), a.getTime() >= o.getTime() && a.getTime() <= s.getTime());
|
|
519
|
-
}
|
|
520
|
-
function st(e, t) {
|
|
521
|
-
return !n(e.start) || !n(e.end) || !n(t.start) || !n(t.end) ? !1 : e.start.getTime() < t.end.getTime() && e.end.getTime() > t.start.getTime();
|
|
522
|
-
}
|
|
523
|
-
function ct(e) {
|
|
524
|
-
return J(e, /* @__PURE__ */ new Date());
|
|
525
|
-
}
|
|
526
|
-
function lt(e) {
|
|
527
|
-
let t = /* @__PURE__ */ new Date();
|
|
528
|
-
return t.setDate(t.getDate() - 1), J(e, t);
|
|
529
|
-
}
|
|
530
|
-
function ut(e) {
|
|
531
|
-
let t = /* @__PURE__ */ new Date();
|
|
532
|
-
return t.setDate(t.getDate() + 1), J(e, t);
|
|
533
|
-
}
|
|
534
|
-
function dt(t) {
|
|
535
|
-
let r = e(t);
|
|
536
|
-
return n(r) ? r.getTime() < Date.now() : !1;
|
|
537
|
-
}
|
|
538
|
-
function ft(t) {
|
|
539
|
-
let r = e(t);
|
|
540
|
-
return n(r) ? r.getTime() > Date.now() : !1;
|
|
541
|
-
}
|
|
542
|
-
function pt(e, t = 0) {
|
|
543
|
-
return Z(e, /* @__PURE__ */ new Date(), t);
|
|
544
|
-
}
|
|
545
|
-
function Q(e) {
|
|
546
|
-
return Y(e, /* @__PURE__ */ new Date());
|
|
547
|
-
}
|
|
548
|
-
function mt(e) {
|
|
549
|
-
return X(e, /* @__PURE__ */ new Date());
|
|
550
|
-
}
|
|
551
|
-
function ht(t) {
|
|
552
|
-
let r = e(t);
|
|
553
|
-
return n(r) ? r.getDate() === 1 : !1;
|
|
554
|
-
}
|
|
555
|
-
function gt(t) {
|
|
556
|
-
let r = e(t);
|
|
557
|
-
if (!n(r)) return !1;
|
|
558
|
-
let i = new Date(r);
|
|
559
|
-
return i.setDate(i.getDate() + 1), i.getMonth() !== r.getMonth();
|
|
560
|
-
}
|
|
561
|
-
function _t(t) {
|
|
562
|
-
let r = e(t);
|
|
563
|
-
if (!n(r)) return !1;
|
|
564
|
-
let i = r.getDay();
|
|
565
|
-
return i === 0 || i === 6;
|
|
566
|
-
}
|
|
567
|
-
function vt(t) {
|
|
568
|
-
let r = e(t);
|
|
569
|
-
if (!n(r)) return !1;
|
|
570
|
-
let i = r.getDay();
|
|
571
|
-
return i >= 1 && i <= 5;
|
|
572
|
-
}
|
|
573
|
-
function yt(t) {
|
|
574
|
-
let r = e(t);
|
|
575
|
-
return n(r) ? r.getHours() < 12 : !1;
|
|
576
|
-
}
|
|
577
|
-
function bt(t) {
|
|
578
|
-
let r = e(t);
|
|
579
|
-
return n(r) ? r.getHours() >= 12 : !1;
|
|
580
|
-
}
|
|
581
|
-
function $(e) {
|
|
582
|
-
let t;
|
|
583
|
-
if (e instanceof Date) {
|
|
584
|
-
if (!n(e)) return !1;
|
|
585
|
-
t = e.getFullYear();
|
|
586
|
-
} else t = e;
|
|
587
|
-
return t % 4 == 0 && t % 100 != 0 || t % 400 == 0;
|
|
588
|
-
}
|
|
589
|
-
function xt(t) {
|
|
590
|
-
let r = e(t);
|
|
591
|
-
return n(r) ? $(r.getFullYear()) : !1;
|
|
592
|
-
}
|
|
593
|
-
//#endregion
|
|
594
|
-
export { xe as addBusinessDays, w as addDays, C as addHours, b as addMilliseconds, S as addMinutes, E as addMonths, x as addSeconds, T as addWeeks, D as addYears, Ce as clampDate, Ee as closestTo, r as createDate, Se as differenceInBusinessDays, V as differenceInDays, B as differenceInHours, L as differenceInMilliseconds, z as differenceInMinutes, H as differenceInMonths, R as differenceInSeconds, be as differenceInWeeks, U as differenceInYears, Fe as durationToMilliseconds, De as eachDayOfInterval, Oe as eachMonthOfInterval, ke as eachYearOfInterval, me as endOfDay, ge as endOfHour, ve as endOfMinute, N as endOfMonth, F as endOfQuarter, j as endOfWeek, ye as endOfYear, Le as format, Re as formatDate, Je as formatDuration, Be as formatISO, He as formatISO9075, Ge as formatRFC2822, Ve as formatRFC3339, ze as formatRelativeTime, Ae as fromUnixTime, o as getDate, f as getDayOfWeek, h as getDayOfYear, p as getDaysInMonth, s as getHours, W as getISOWeek, u as getMilliseconds, c as getMinutes, a as getMonth, m as getQuarter, l as getSeconds, d as getTimestamp, i as getYear, Pe as intervalToDuration, yt as isAM, it as isAfter, rt as isBefore, t as isDate, at as isEqual, ht as isFirstDayOfMonth, ft as isFuture, xt as isInLeapYear, gt as isLastDayOfMonth, $ as isLeapYear, st as isOverlapping, bt as isPM, dt as isPast, J as isSameDay, $e as isSameHour, et as isSameMinute, Y as isSameMonth, Qe as isSameQuarter, tt as isSameSecond, nt as isSameTime, Z as isSameWeek, X as isSameYear, Q as isThisMonth, pt as isThisWeek, mt as isThisYear, ct as isToday, ut as isTomorrow, n as isValid, vt as isWeekday, _t as isWeekend, ot as isWithinRange, lt as isYesterday, Te as max, we as min, Ze as parseISO, Me as roundToNearestMinutes, le as setDate, ue as setHours, Ne as setISOWeek, pe as setMilliseconds, de as setMinutes, ce as setMonth, fe as setSeconds, se as setYear, k as startOfDay, he as startOfHour, _e as startOfMinute, M as startOfMonth, P as startOfQuarter, A as startOfWeek, I as startOfYear, re as subDays, ne as subHours, ee as subMilliseconds, O as subMinutes, ae as subMonths, te as subSeconds, ie as subWeeks, oe as subYears, e as toDate, Ye as toISOString, je as toUnixTime };
|