@utilix-tech/sdk 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.
- package/LICENSE +21 -0
- package/README.md +199 -0
- package/dist/api-8aZtWhSj.d.cts +308 -0
- package/dist/api-8aZtWhSj.d.ts +308 -0
- package/dist/chunk-2CJSLYWI.js +520 -0
- package/dist/chunk-3BAHSW4C.js +1385 -0
- package/dist/chunk-6YPV2AB5.js +1246 -0
- package/dist/chunk-BPVAB4P2.js +1126 -0
- package/dist/chunk-FL53T24A.js +257 -0
- package/dist/chunk-L6KCTHUW.js +1086 -0
- package/dist/chunk-MLKGABMK.js +7 -0
- package/dist/chunk-ROTPLW7T.js +265 -0
- package/dist/chunk-TSAGO3XP.js +1253 -0
- package/dist/chunk-UC656APA.js +1080 -0
- package/dist/chunk-W4UBLYFU.js +1219 -0
- package/dist/chunk-XST6X3HT.js +896 -0
- package/dist/chunk-XXYZLLHI.js +2227 -0
- package/dist/chunk-ZKL2VX2G.js +2215 -0
- package/dist/chunk-ZPQZEIXP.js +685 -0
- package/dist/code-QNrdLIR3.d.cts +327 -0
- package/dist/code-QNrdLIR3.d.ts +327 -0
- package/dist/color-tPwZCr9H.d.cts +229 -0
- package/dist/color-tPwZCr9H.d.ts +229 -0
- package/dist/css-Cf7AMGM-.d.cts +318 -0
- package/dist/css-Cf7AMGM-.d.ts +318 -0
- package/dist/data-rMjWNiOJ.d.cts +215 -0
- package/dist/data-rMjWNiOJ.d.ts +215 -0
- package/dist/encoding-7gmq-vkV.d.cts +108 -0
- package/dist/encoding-7gmq-vkV.d.ts +108 -0
- package/dist/generators-BGtRGpJZ.d.cts +118 -0
- package/dist/generators-BGtRGpJZ.d.ts +118 -0
- package/dist/hashing-CnetQFD_.d.cts +76 -0
- package/dist/hashing-CnetQFD_.d.ts +76 -0
- package/dist/index.cjs +15466 -0
- package/dist/index.d.cts +18 -0
- package/dist/index.d.ts +18 -0
- package/dist/index.js +20 -0
- package/dist/json-BjSoIS1h.d.cts +198 -0
- package/dist/json-BjSoIS1h.d.ts +198 -0
- package/dist/misc-DcVBManm.d.cts +201 -0
- package/dist/misc-DcVBManm.d.ts +201 -0
- package/dist/network-CNtmrDeN.d.cts +170 -0
- package/dist/network-CNtmrDeN.d.ts +170 -0
- package/dist/text-DqAjPtQ0.d.cts +319 -0
- package/dist/text-DqAjPtQ0.d.ts +319 -0
- package/dist/time-DbT8fjaF.d.cts +145 -0
- package/dist/time-DbT8fjaF.d.ts +145 -0
- package/dist/tools/api.cjs +1216 -0
- package/dist/tools/api.d.cts +1 -0
- package/dist/tools/api.d.ts +1 -0
- package/dist/tools/api.js +2 -0
- package/dist/tools/code.cjs +2212 -0
- package/dist/tools/code.d.cts +1 -0
- package/dist/tools/code.d.ts +1 -0
- package/dist/tools/code.js +2 -0
- package/dist/tools/color.cjs +1122 -0
- package/dist/tools/color.d.cts +1 -0
- package/dist/tools/color.d.ts +1 -0
- package/dist/tools/color.js +2 -0
- package/dist/tools/css.cjs +1242 -0
- package/dist/tools/css.d.cts +1 -0
- package/dist/tools/css.d.ts +1 -0
- package/dist/tools/css.js +2 -0
- package/dist/tools/data.cjs +1097 -0
- package/dist/tools/data.d.cts +1 -0
- package/dist/tools/data.d.ts +1 -0
- package/dist/tools/data.js +2 -0
- package/dist/tools/encoding.cjs +261 -0
- package/dist/tools/encoding.d.cts +1 -0
- package/dist/tools/encoding.d.ts +1 -0
- package/dist/tools/encoding.js +2 -0
- package/dist/tools/generators.cjs +521 -0
- package/dist/tools/generators.d.cts +1 -0
- package/dist/tools/generators.d.ts +1 -0
- package/dist/tools/generators.js +2 -0
- package/dist/tools/hashing.cjs +259 -0
- package/dist/tools/hashing.d.cts +1 -0
- package/dist/tools/hashing.d.ts +1 -0
- package/dist/tools/hashing.js +2 -0
- package/dist/tools/json.cjs +1270 -0
- package/dist/tools/json.d.cts +1 -0
- package/dist/tools/json.d.ts +1 -0
- package/dist/tools/json.js +2 -0
- package/dist/tools/misc.cjs +1082 -0
- package/dist/tools/misc.d.cts +1 -0
- package/dist/tools/misc.d.ts +1 -0
- package/dist/tools/misc.js +2 -0
- package/dist/tools/network.cjs +1381 -0
- package/dist/tools/network.d.cts +1 -0
- package/dist/tools/network.d.ts +1 -0
- package/dist/tools/network.js +2 -0
- package/dist/tools/text.cjs +2224 -0
- package/dist/tools/text.d.cts +1 -0
- package/dist/tools/text.d.ts +1 -0
- package/dist/tools/text.js +2 -0
- package/dist/tools/time.cjs +681 -0
- package/dist/tools/time.d.cts +1 -0
- package/dist/tools/time.d.ts +1 -0
- package/dist/tools/time.js +2 -0
- package/dist/tools/units.cjs +892 -0
- package/dist/tools/units.d.cts +1 -0
- package/dist/tools/units.d.ts +1 -0
- package/dist/tools/units.js +2 -0
- package/dist/units-6lwDYBvX.d.cts +302 -0
- package/dist/units-6lwDYBvX.d.ts +302 -0
- package/package.json +148 -0
|
@@ -0,0 +1,681 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
// src/tools/time.ts
|
|
4
|
+
function formatRelative(diffMs) {
|
|
5
|
+
const absMs = Math.abs(diffMs);
|
|
6
|
+
const isPast = diffMs >= 0;
|
|
7
|
+
if (absMs < 1e4) {
|
|
8
|
+
return "just now";
|
|
9
|
+
}
|
|
10
|
+
const seconds = Math.floor(absMs / 1e3);
|
|
11
|
+
if (seconds < 60) {
|
|
12
|
+
return isPast ? `${seconds} seconds ago` : `in ${seconds} seconds`;
|
|
13
|
+
}
|
|
14
|
+
const minutes = Math.floor(absMs / 6e4);
|
|
15
|
+
if (minutes < 60) {
|
|
16
|
+
return isPast ? `${minutes} minutes ago` : `in ${minutes} minutes`;
|
|
17
|
+
}
|
|
18
|
+
const hours = Math.floor(absMs / 36e5);
|
|
19
|
+
if (hours < 24) {
|
|
20
|
+
return isPast ? `${hours} hours ago` : `in ${hours} hours`;
|
|
21
|
+
}
|
|
22
|
+
const days = Math.floor(absMs / 864e5);
|
|
23
|
+
return isPast ? `${days} days ago` : `in ${days} days`;
|
|
24
|
+
}
|
|
25
|
+
function buildResult(date) {
|
|
26
|
+
const unixMs = date.getTime();
|
|
27
|
+
const unix = Math.floor(unixMs / 1e3);
|
|
28
|
+
const diffMs = Date.now() - unixMs;
|
|
29
|
+
return {
|
|
30
|
+
unix,
|
|
31
|
+
unixMs,
|
|
32
|
+
iso: date.toISOString(),
|
|
33
|
+
utc: date.toUTCString(),
|
|
34
|
+
local: date.toLocaleString(),
|
|
35
|
+
relative: formatRelative(diffMs)
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
function fromUnix(ts) {
|
|
39
|
+
const ms = ts > 1e10 ? ts : ts * 1e3;
|
|
40
|
+
return buildResult(new Date(ms));
|
|
41
|
+
}
|
|
42
|
+
function fromIsoString(iso) {
|
|
43
|
+
if (!iso || iso.trim() === "") {
|
|
44
|
+
return { error: "Empty string is not a valid ISO date" };
|
|
45
|
+
}
|
|
46
|
+
const date = new Date(iso);
|
|
47
|
+
if (isNaN(date.getTime())) {
|
|
48
|
+
return { error: `Invalid ISO string: "${iso}"` };
|
|
49
|
+
}
|
|
50
|
+
return buildResult(date);
|
|
51
|
+
}
|
|
52
|
+
function getNow() {
|
|
53
|
+
return buildResult(/* @__PURE__ */ new Date());
|
|
54
|
+
}
|
|
55
|
+
var CRON_MONTH_NAMES = [
|
|
56
|
+
"January",
|
|
57
|
+
"February",
|
|
58
|
+
"March",
|
|
59
|
+
"April",
|
|
60
|
+
"May",
|
|
61
|
+
"June",
|
|
62
|
+
"July",
|
|
63
|
+
"August",
|
|
64
|
+
"September",
|
|
65
|
+
"October",
|
|
66
|
+
"November",
|
|
67
|
+
"December"
|
|
68
|
+
];
|
|
69
|
+
var CRON_WEEKDAY_NAMES = [
|
|
70
|
+
"Sunday",
|
|
71
|
+
"Monday",
|
|
72
|
+
"Tuesday",
|
|
73
|
+
"Wednesday",
|
|
74
|
+
"Thursday",
|
|
75
|
+
"Friday",
|
|
76
|
+
"Saturday"
|
|
77
|
+
];
|
|
78
|
+
var FIELD_CONFIGS = {
|
|
79
|
+
minute: { min: 0, max: 59, singularLabel: "minute", pluralLabel: "minutes", unit: "minute" },
|
|
80
|
+
hour: { min: 0, max: 23, singularLabel: "hour", pluralLabel: "hours", unit: "hour" },
|
|
81
|
+
day: { min: 1, max: 31, singularLabel: "day", pluralLabel: "days", unit: "day" },
|
|
82
|
+
month: { min: 1, max: 12, singularLabel: "month", pluralLabel: "months", unit: "month", names: CRON_MONTH_NAMES, nameOffset: 1 },
|
|
83
|
+
weekday: { min: 0, max: 7, singularLabel: "weekday", pluralLabel: "weekdays", unit: "weekday", names: CRON_WEEKDAY_NAMES, nameOffset: 0 }
|
|
84
|
+
};
|
|
85
|
+
function getCronName(config, value) {
|
|
86
|
+
if (!config.names) return null;
|
|
87
|
+
const idx = value - (config.nameOffset ?? 0);
|
|
88
|
+
const resolvedIdx = config.unit === "weekday" && value === 7 ? 0 : idx;
|
|
89
|
+
return config.names[resolvedIdx] ?? null;
|
|
90
|
+
}
|
|
91
|
+
function isValidNumber(value, min, max) {
|
|
92
|
+
return Number.isInteger(value) && value >= min && value <= max;
|
|
93
|
+
}
|
|
94
|
+
function validateValue(value, config) {
|
|
95
|
+
return isValidNumber(value, config.min, config.max);
|
|
96
|
+
}
|
|
97
|
+
function describeField(raw, fieldType) {
|
|
98
|
+
const config = FIELD_CONFIGS[fieldType];
|
|
99
|
+
const everyLabel = `every ${config.unit}`;
|
|
100
|
+
if (raw === "*") {
|
|
101
|
+
return { raw, description: everyLabel, valid: true };
|
|
102
|
+
}
|
|
103
|
+
const stepMatch = raw.match(/^\*\/(\d+)$/);
|
|
104
|
+
if (stepMatch) {
|
|
105
|
+
const step = parseInt(stepMatch[1], 10);
|
|
106
|
+
if (step < 1) return { raw, description: "", valid: false };
|
|
107
|
+
return { raw, description: `every ${step} ${config.pluralLabel}`, valid: true };
|
|
108
|
+
}
|
|
109
|
+
const rangeMatch = raw.match(/^(\d+)-(\d+)$/);
|
|
110
|
+
if (rangeMatch) {
|
|
111
|
+
const from = parseInt(rangeMatch[1], 10);
|
|
112
|
+
const to = parseInt(rangeMatch[2], 10);
|
|
113
|
+
if (!validateValue(from, config) || !validateValue(to, config)) {
|
|
114
|
+
return { raw, description: "", valid: false };
|
|
115
|
+
}
|
|
116
|
+
const fromName = getCronName(config, from);
|
|
117
|
+
const toName = getCronName(config, to);
|
|
118
|
+
if (fromName && toName) {
|
|
119
|
+
return { raw, description: `${fromName} through ${toName}`, valid: true };
|
|
120
|
+
}
|
|
121
|
+
return { raw, description: `${config.unit} ${from} through ${to}`, valid: true };
|
|
122
|
+
}
|
|
123
|
+
if (raw.includes(",")) {
|
|
124
|
+
const parts = raw.split(",");
|
|
125
|
+
const values = [];
|
|
126
|
+
for (const part of parts) {
|
|
127
|
+
const n2 = parseInt(part.trim(), 10);
|
|
128
|
+
if (isNaN(n2) || !validateValue(n2, config)) {
|
|
129
|
+
return { raw, description: "", valid: false };
|
|
130
|
+
}
|
|
131
|
+
values.push(n2);
|
|
132
|
+
}
|
|
133
|
+
const resolved = values.map((v) => getCronName(config, v) ?? String(v));
|
|
134
|
+
const label = config.unit === "minute" || config.unit === "hour" || config.unit === "day" ? `${config.pluralLabel} ${resolved.join(", ")}` : resolved.join(", ");
|
|
135
|
+
return { raw, description: label, valid: true };
|
|
136
|
+
}
|
|
137
|
+
const n = parseInt(raw, 10);
|
|
138
|
+
if (isNaN(n) || !validateValue(n, config)) {
|
|
139
|
+
return { raw, description: "", valid: false };
|
|
140
|
+
}
|
|
141
|
+
const name = getCronName(config, n);
|
|
142
|
+
if (name) {
|
|
143
|
+
if (config.unit === "month") {
|
|
144
|
+
return { raw, description: `in ${name}`, valid: true };
|
|
145
|
+
}
|
|
146
|
+
if (config.unit === "weekday") {
|
|
147
|
+
return { raw, description: `on ${name}`, valid: true };
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
const prefix = {
|
|
151
|
+
minute: "at minute",
|
|
152
|
+
hour: "at hour",
|
|
153
|
+
day: "on day",
|
|
154
|
+
month: "in month",
|
|
155
|
+
weekday: "on weekday"
|
|
156
|
+
};
|
|
157
|
+
return { raw, description: `${prefix[fieldType]} ${n}`, valid: true };
|
|
158
|
+
}
|
|
159
|
+
function parseCron(expr) {
|
|
160
|
+
const raw = expr;
|
|
161
|
+
const parts = expr.trim().split(/\s+/);
|
|
162
|
+
if (parts.length !== 5) {
|
|
163
|
+
return {
|
|
164
|
+
raw,
|
|
165
|
+
fields: {
|
|
166
|
+
minute: { raw: "", description: "", valid: false },
|
|
167
|
+
hour: { raw: "", description: "", valid: false },
|
|
168
|
+
day: { raw: "", description: "", valid: false },
|
|
169
|
+
month: { raw: "", description: "", valid: false },
|
|
170
|
+
weekday: { raw: "", description: "", valid: false }
|
|
171
|
+
},
|
|
172
|
+
summary: "",
|
|
173
|
+
valid: false,
|
|
174
|
+
error: `Expected 5 fields but got ${parts.length}`
|
|
175
|
+
};
|
|
176
|
+
}
|
|
177
|
+
const [minuteRaw, hourRaw, dayRaw, monthRaw, weekdayRaw] = parts;
|
|
178
|
+
const minute = describeField(minuteRaw, "minute");
|
|
179
|
+
const hour = describeField(hourRaw, "hour");
|
|
180
|
+
const day = describeField(dayRaw, "day");
|
|
181
|
+
const month = describeField(monthRaw, "month");
|
|
182
|
+
const weekday = describeField(weekdayRaw, "weekday");
|
|
183
|
+
const allValid = minute.valid && hour.valid && day.valid && month.valid && weekday.valid;
|
|
184
|
+
if (!allValid) {
|
|
185
|
+
const invalidField = [
|
|
186
|
+
!minute.valid && "minute",
|
|
187
|
+
!hour.valid && "hour",
|
|
188
|
+
!day.valid && "day",
|
|
189
|
+
!month.valid && "month",
|
|
190
|
+
!weekday.valid && "weekday"
|
|
191
|
+
].filter(Boolean).join(", ");
|
|
192
|
+
return {
|
|
193
|
+
raw,
|
|
194
|
+
fields: { minute, hour, day, month, weekday },
|
|
195
|
+
summary: "",
|
|
196
|
+
valid: false,
|
|
197
|
+
error: `Invalid field(s): ${invalidField}`
|
|
198
|
+
};
|
|
199
|
+
}
|
|
200
|
+
const summary = `At ${minute.description}, ${hour.description}, ${day.description}, ${month.description}, ${weekday.description}`;
|
|
201
|
+
return {
|
|
202
|
+
raw,
|
|
203
|
+
fields: { minute, hour, day, month, weekday },
|
|
204
|
+
summary,
|
|
205
|
+
valid: true
|
|
206
|
+
};
|
|
207
|
+
}
|
|
208
|
+
var COMMON_CRONS = [
|
|
209
|
+
{ expr: "* * * * *", label: "Every minute" },
|
|
210
|
+
{ expr: "0 * * * *", label: "Every hour" },
|
|
211
|
+
{ expr: "0 0 * * *", label: "Every day at midnight" },
|
|
212
|
+
{ expr: "0 9 * * 1-5", label: "Weekdays at 9am" },
|
|
213
|
+
{ expr: "0 0 * * 0", label: "Every Sunday at midnight" },
|
|
214
|
+
{ expr: "0 0 1 * *", label: "First day of every month" },
|
|
215
|
+
{ expr: "0 0 1 1 *", label: "Every year on January 1st" },
|
|
216
|
+
{ expr: "*/15 * * * *", label: "Every 15 minutes" },
|
|
217
|
+
{ expr: "0 0 * * 1", label: "Every Monday at midnight" }
|
|
218
|
+
];
|
|
219
|
+
function parseDate(input) {
|
|
220
|
+
if (!input || !input.trim()) return null;
|
|
221
|
+
const trimmed = input.trim();
|
|
222
|
+
const isoDate = trimmed.match(/^(\d{4})-(\d{2})-(\d{2})$/);
|
|
223
|
+
if (isoDate) {
|
|
224
|
+
const d = /* @__PURE__ */ new Date(`${trimmed}T00:00:00.000Z`);
|
|
225
|
+
return isNaN(d.getTime()) ? null : d;
|
|
226
|
+
}
|
|
227
|
+
const mdyMatch = trimmed.match(/^(\d{1,2})\/(\d{1,2})\/(\d{4})$/);
|
|
228
|
+
if (mdyMatch) {
|
|
229
|
+
const month = parseInt(mdyMatch[1]);
|
|
230
|
+
const day = parseInt(mdyMatch[2]);
|
|
231
|
+
const year = parseInt(mdyMatch[3]);
|
|
232
|
+
if (month < 1 || month > 12 || day < 1 || day > 31) return null;
|
|
233
|
+
const d = /* @__PURE__ */ new Date(`${year}-${String(month).padStart(2, "0")}-${String(day).padStart(2, "0")}T00:00:00.000Z`);
|
|
234
|
+
return isNaN(d.getTime()) ? null : d;
|
|
235
|
+
}
|
|
236
|
+
const dmyMatch = trimmed.match(/^(\d{1,2})-(\d{1,2})-(\d{4})$/);
|
|
237
|
+
if (dmyMatch) {
|
|
238
|
+
const day = parseInt(dmyMatch[1]);
|
|
239
|
+
const month = parseInt(dmyMatch[2]);
|
|
240
|
+
const year = parseInt(dmyMatch[3]);
|
|
241
|
+
if (month < 1 || month > 12 || day < 1 || day > 31) return null;
|
|
242
|
+
const d = /* @__PURE__ */ new Date(`${year}-${String(month).padStart(2, "0")}-${String(day).padStart(2, "0")}T00:00:00.000Z`);
|
|
243
|
+
return isNaN(d.getTime()) ? null : d;
|
|
244
|
+
}
|
|
245
|
+
const isoFull = new Date(trimmed);
|
|
246
|
+
if (!isNaN(isoFull.getTime())) return isoFull;
|
|
247
|
+
return null;
|
|
248
|
+
}
|
|
249
|
+
function humanizeDiff(result) {
|
|
250
|
+
const parts = [];
|
|
251
|
+
const units = [
|
|
252
|
+
{ label: "year", value: result.years },
|
|
253
|
+
{ label: "month", value: result.months },
|
|
254
|
+
{ label: "week", value: result.weeks },
|
|
255
|
+
{ label: "day", value: result.days },
|
|
256
|
+
{ label: "hour", value: result.hours },
|
|
257
|
+
{ label: "minute", value: result.minutes },
|
|
258
|
+
{ label: "second", value: result.seconds }
|
|
259
|
+
];
|
|
260
|
+
for (const { label, value } of units) {
|
|
261
|
+
if (value > 0 && parts.length < 3) {
|
|
262
|
+
parts.push(`${value} ${label}${value !== 1 ? "s" : ""}`);
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
return parts.length > 0 ? parts.join(", ") : "0 seconds";
|
|
266
|
+
}
|
|
267
|
+
function diffDates(from, to) {
|
|
268
|
+
const fromDate = parseDate(from);
|
|
269
|
+
const toDate = parseDate(to);
|
|
270
|
+
if (!fromDate) return { error: `Invalid "from" date: ${from}` };
|
|
271
|
+
if (!toDate) return { error: `Invalid "to" date: ${to}` };
|
|
272
|
+
const fromMs = fromDate.getTime();
|
|
273
|
+
const toMs = toDate.getTime();
|
|
274
|
+
const isPast = toMs < fromMs;
|
|
275
|
+
const startMs = Math.min(fromMs, toMs);
|
|
276
|
+
const endMs = Math.max(fromMs, toMs);
|
|
277
|
+
const diffMs = endMs - startMs;
|
|
278
|
+
const totalSeconds = Math.floor(diffMs / 1e3);
|
|
279
|
+
const totalMinutes = Math.floor(diffMs / (1e3 * 60));
|
|
280
|
+
const totalHours = Math.floor(diffMs / (1e3 * 60 * 60));
|
|
281
|
+
const totalDays = Math.floor(diffMs / (1e3 * 60 * 60 * 24));
|
|
282
|
+
const startDate = new Date(startMs);
|
|
283
|
+
const endDate = new Date(endMs);
|
|
284
|
+
let years = endDate.getUTCFullYear() - startDate.getUTCFullYear();
|
|
285
|
+
let months = endDate.getUTCMonth() - startDate.getUTCMonth();
|
|
286
|
+
let days = endDate.getUTCDate() - startDate.getUTCDate();
|
|
287
|
+
if (days < 0) {
|
|
288
|
+
months -= 1;
|
|
289
|
+
const prevMonth = new Date(Date.UTC(endDate.getUTCFullYear(), endDate.getUTCMonth(), 0));
|
|
290
|
+
days += prevMonth.getUTCDate();
|
|
291
|
+
}
|
|
292
|
+
if (months < 0) {
|
|
293
|
+
years -= 1;
|
|
294
|
+
months += 12;
|
|
295
|
+
}
|
|
296
|
+
const weeks = Math.floor(days / 7);
|
|
297
|
+
const remainingDays = days % 7;
|
|
298
|
+
const remainingAfterDays = diffMs - (years * 365.25 * 24 * 3600 * 1e3 + months * 30.44 * 24 * 3600 * 1e3 + days * 24 * 3600 * 1e3);
|
|
299
|
+
const hours = Math.floor(Math.max(0, remainingAfterDays) / (1e3 * 60 * 60));
|
|
300
|
+
const minutes = Math.floor(Math.max(0, remainingAfterDays) % (1e3 * 60 * 60) / (1e3 * 60));
|
|
301
|
+
const seconds = Math.floor(Math.max(0, remainingAfterDays) % (1e3 * 60) / 1e3);
|
|
302
|
+
const result = {
|
|
303
|
+
years,
|
|
304
|
+
months,
|
|
305
|
+
weeks,
|
|
306
|
+
days: remainingDays,
|
|
307
|
+
hours,
|
|
308
|
+
minutes,
|
|
309
|
+
seconds,
|
|
310
|
+
totalDays,
|
|
311
|
+
totalHours,
|
|
312
|
+
totalMinutes,
|
|
313
|
+
totalSeconds,
|
|
314
|
+
isPast,
|
|
315
|
+
humanReadable: ""
|
|
316
|
+
};
|
|
317
|
+
result.humanReadable = humanizeDiff(result);
|
|
318
|
+
return result;
|
|
319
|
+
}
|
|
320
|
+
var COMMON_DATE_PRESETS = [
|
|
321
|
+
{ label: "Last 7 days", from: () => "2020-01-01", to: () => "2020-01-08" },
|
|
322
|
+
{ label: "Last 30 days", from: () => "2020-01-01", to: () => "2020-01-31" },
|
|
323
|
+
{ label: "Last 90 days", from: () => "2020-01-01", to: () => "2020-04-01" },
|
|
324
|
+
{ label: "Last 6 months", from: () => "2020-01-01", to: () => "2020-07-01" },
|
|
325
|
+
{ label: "Last 1 year", from: () => "2020-01-01", to: () => "2021-01-01" },
|
|
326
|
+
{ label: "Year 2020", from: () => "2020-01-01", to: () => "2020-12-31" },
|
|
327
|
+
{ label: "Year 2021", from: () => "2021-01-01", to: () => "2021-12-31" }
|
|
328
|
+
];
|
|
329
|
+
var TIMEZONES = [
|
|
330
|
+
{ tz: "UTC", label: "UTC (Coordinated Universal Time)", offset: "+00:00" },
|
|
331
|
+
{ tz: "America/New_York", label: "New York (Eastern)", offset: "-05:00" },
|
|
332
|
+
{ tz: "America/Chicago", label: "Chicago (Central)", offset: "-06:00" },
|
|
333
|
+
{ tz: "America/Denver", label: "Denver (Mountain)", offset: "-07:00" },
|
|
334
|
+
{ tz: "America/Los_Angeles", label: "Los Angeles (Pacific)", offset: "-08:00" },
|
|
335
|
+
{ tz: "America/Sao_Paulo", label: "S\xE3o Paulo (BRT)", offset: "-03:00" },
|
|
336
|
+
{ tz: "America/Toronto", label: "Toronto (Eastern)", offset: "-05:00" },
|
|
337
|
+
{ tz: "America/Vancouver", label: "Vancouver (Pacific)", offset: "-08:00" },
|
|
338
|
+
{ tz: "America/Mexico_City", label: "Mexico City (CST)", offset: "-06:00" },
|
|
339
|
+
{ tz: "America/Buenos_Aires", label: "Buenos Aires (ART)", offset: "-03:00" },
|
|
340
|
+
{ tz: "Europe/London", label: "London (GMT/BST)", offset: "+00:00" },
|
|
341
|
+
{ tz: "Europe/Paris", label: "Paris (CET)", offset: "+01:00" },
|
|
342
|
+
{ tz: "Europe/Berlin", label: "Berlin (CET)", offset: "+01:00" },
|
|
343
|
+
{ tz: "Europe/Rome", label: "Rome (CET)", offset: "+01:00" },
|
|
344
|
+
{ tz: "Europe/Amsterdam", label: "Amsterdam (CET)", offset: "+01:00" },
|
|
345
|
+
{ tz: "Europe/Moscow", label: "Moscow (MSK)", offset: "+03:00" },
|
|
346
|
+
{ tz: "Africa/Cairo", label: "Cairo (EET)", offset: "+02:00" },
|
|
347
|
+
{ tz: "Africa/Lagos", label: "Lagos (WAT)", offset: "+01:00" },
|
|
348
|
+
{ tz: "Asia/Dubai", label: "Dubai (GST)", offset: "+04:00" },
|
|
349
|
+
{ tz: "Asia/Karachi", label: "Karachi (PKT)", offset: "+05:00" },
|
|
350
|
+
{ tz: "Asia/Kolkata", label: "Kolkata (IST)", offset: "+05:30" },
|
|
351
|
+
{ tz: "Asia/Bangkok", label: "Bangkok (ICT)", offset: "+07:00" },
|
|
352
|
+
{ tz: "Asia/Jakarta", label: "Jakarta (WIB)", offset: "+07:00" },
|
|
353
|
+
{ tz: "Asia/Singapore", label: "Singapore (SGT)", offset: "+08:00" },
|
|
354
|
+
{ tz: "Asia/Shanghai", label: "Shanghai (CST)", offset: "+08:00" },
|
|
355
|
+
{ tz: "Asia/Seoul", label: "Seoul (KST)", offset: "+09:00" },
|
|
356
|
+
{ tz: "Asia/Tokyo", label: "Tokyo (JST)", offset: "+09:00" },
|
|
357
|
+
{ tz: "Australia/Sydney", label: "Sydney (AEDT)", offset: "+11:00" },
|
|
358
|
+
{ tz: "Pacific/Auckland", label: "Auckland (NZDT)", offset: "+13:00" },
|
|
359
|
+
{ tz: "Pacific/Honolulu", label: "Honolulu (HST)", offset: "-10:00" }
|
|
360
|
+
];
|
|
361
|
+
function getTimezoneOffset(tz, isoString) {
|
|
362
|
+
try {
|
|
363
|
+
const date = new Date(isoString);
|
|
364
|
+
if (isNaN(date.getTime())) {
|
|
365
|
+
return "+00:00";
|
|
366
|
+
}
|
|
367
|
+
const utcFormatter = new Intl.DateTimeFormat("en-US", {
|
|
368
|
+
timeZone: "UTC",
|
|
369
|
+
year: "numeric",
|
|
370
|
+
month: "2-digit",
|
|
371
|
+
day: "2-digit",
|
|
372
|
+
hour: "2-digit",
|
|
373
|
+
minute: "2-digit",
|
|
374
|
+
hour12: false
|
|
375
|
+
});
|
|
376
|
+
const tzFormatter = new Intl.DateTimeFormat("en-US", {
|
|
377
|
+
timeZone: tz,
|
|
378
|
+
year: "numeric",
|
|
379
|
+
month: "2-digit",
|
|
380
|
+
day: "2-digit",
|
|
381
|
+
hour: "2-digit",
|
|
382
|
+
minute: "2-digit",
|
|
383
|
+
hour12: false
|
|
384
|
+
});
|
|
385
|
+
const utcParts = utcFormatter.formatToParts(date);
|
|
386
|
+
const tzParts = tzFormatter.formatToParts(date);
|
|
387
|
+
const getPart = (parts, type) => {
|
|
388
|
+
const part = parts.find((p) => p.type === type);
|
|
389
|
+
return part ? parseInt(part.value, 10) : 0;
|
|
390
|
+
};
|
|
391
|
+
const utcYear = getPart(utcParts, "year");
|
|
392
|
+
const utcMonth = getPart(utcParts, "month") - 1;
|
|
393
|
+
const utcDay = getPart(utcParts, "day");
|
|
394
|
+
const utcHour = getPart(utcParts, "hour") % 24;
|
|
395
|
+
const utcMin = getPart(utcParts, "minute");
|
|
396
|
+
const tzYear = getPart(tzParts, "year");
|
|
397
|
+
const tzMonth = getPart(tzParts, "month") - 1;
|
|
398
|
+
const tzDay = getPart(tzParts, "day");
|
|
399
|
+
const tzHour = getPart(tzParts, "hour") % 24;
|
|
400
|
+
const tzMin = getPart(tzParts, "minute");
|
|
401
|
+
const utcMs = Date.UTC(utcYear, utcMonth, utcDay, utcHour, utcMin);
|
|
402
|
+
const tzMs = Date.UTC(tzYear, tzMonth, tzDay, tzHour, tzMin);
|
|
403
|
+
const diffMinutes = Math.round((tzMs - utcMs) / 6e4);
|
|
404
|
+
const sign = diffMinutes >= 0 ? "+" : "-";
|
|
405
|
+
const absDiff = Math.abs(diffMinutes);
|
|
406
|
+
const hours = Math.floor(absDiff / 60);
|
|
407
|
+
const minutes = absDiff % 60;
|
|
408
|
+
return `${sign}${String(hours).padStart(2, "0")}:${String(minutes).padStart(2, "0")}`;
|
|
409
|
+
} catch {
|
|
410
|
+
return "+00:00";
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
function convertTime(isoString, fromTz, toTz) {
|
|
414
|
+
try {
|
|
415
|
+
const date = new Date(isoString);
|
|
416
|
+
if (isNaN(date.getTime())) {
|
|
417
|
+
return { result: "", error: "Invalid date string" };
|
|
418
|
+
}
|
|
419
|
+
try {
|
|
420
|
+
new Intl.DateTimeFormat("en-US", { timeZone: fromTz });
|
|
421
|
+
} catch {
|
|
422
|
+
return { result: "", error: `Invalid source timezone: ${fromTz}` };
|
|
423
|
+
}
|
|
424
|
+
try {
|
|
425
|
+
new Intl.DateTimeFormat("en-US", { timeZone: toTz });
|
|
426
|
+
} catch {
|
|
427
|
+
return { result: "", error: `Invalid target timezone: ${toTz}` };
|
|
428
|
+
}
|
|
429
|
+
const formatted = formatInTimezone(isoString, toTz);
|
|
430
|
+
const result = `${formatted.date}T${formatted.time}${formatted.offset}`;
|
|
431
|
+
return { result };
|
|
432
|
+
} catch (e) {
|
|
433
|
+
return { result: "", error: String(e) };
|
|
434
|
+
}
|
|
435
|
+
}
|
|
436
|
+
function formatInTimezone(isoString, tz) {
|
|
437
|
+
const date = new Date(isoString);
|
|
438
|
+
const formatter = new Intl.DateTimeFormat("en-CA", {
|
|
439
|
+
timeZone: tz,
|
|
440
|
+
year: "numeric",
|
|
441
|
+
month: "2-digit",
|
|
442
|
+
day: "2-digit",
|
|
443
|
+
hour: "2-digit",
|
|
444
|
+
minute: "2-digit",
|
|
445
|
+
second: "2-digit",
|
|
446
|
+
hour12: false
|
|
447
|
+
});
|
|
448
|
+
const parts = formatter.formatToParts(date);
|
|
449
|
+
const getPart = (type) => {
|
|
450
|
+
const part = parts.find((p) => p.type === type);
|
|
451
|
+
return part ? part.value : "00";
|
|
452
|
+
};
|
|
453
|
+
const year = getPart("year");
|
|
454
|
+
const month = getPart("month");
|
|
455
|
+
const day = getPart("day");
|
|
456
|
+
let hour = getPart("hour");
|
|
457
|
+
const minute = getPart("minute");
|
|
458
|
+
const second = getPart("second");
|
|
459
|
+
if (hour === "24") hour = "00";
|
|
460
|
+
const dateStr = `${year}-${month}-${day}`;
|
|
461
|
+
const timeStr = `${hour}:${minute}:${second}`;
|
|
462
|
+
const offset = getTimezoneOffset(tz, isoString);
|
|
463
|
+
const entry = TIMEZONES.find((t) => t.tz === tz);
|
|
464
|
+
const label = entry ? entry.label : tz;
|
|
465
|
+
return { date: dateStr, time: timeStr, offset, label };
|
|
466
|
+
}
|
|
467
|
+
function getAllZonesForTime(isoString) {
|
|
468
|
+
return TIMEZONES.map((entry) => {
|
|
469
|
+
const formatted = formatInTimezone(isoString, entry.tz);
|
|
470
|
+
const localTime = `${formatted.date}T${formatted.time}${formatted.offset}`;
|
|
471
|
+
return { ...entry, localTime };
|
|
472
|
+
});
|
|
473
|
+
}
|
|
474
|
+
var CRON_NEXT_MONTH_NAMES = {
|
|
475
|
+
JAN: 1,
|
|
476
|
+
FEB: 2,
|
|
477
|
+
MAR: 3,
|
|
478
|
+
APR: 4,
|
|
479
|
+
MAY: 5,
|
|
480
|
+
JUN: 6,
|
|
481
|
+
JUL: 7,
|
|
482
|
+
AUG: 8,
|
|
483
|
+
SEP: 9,
|
|
484
|
+
OCT: 10,
|
|
485
|
+
NOV: 11,
|
|
486
|
+
DEC: 12
|
|
487
|
+
};
|
|
488
|
+
var CRON_NEXT_WEEKDAY_NAMES = {
|
|
489
|
+
SUN: 0,
|
|
490
|
+
MON: 1,
|
|
491
|
+
TUE: 2,
|
|
492
|
+
WED: 3,
|
|
493
|
+
THU: 4,
|
|
494
|
+
FRI: 5,
|
|
495
|
+
SAT: 6
|
|
496
|
+
};
|
|
497
|
+
var DAY_NAMES = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"];
|
|
498
|
+
function resolveNamedValue(token, nameMap) {
|
|
499
|
+
const upper = token.toUpperCase();
|
|
500
|
+
if (upper in nameMap) return nameMap[upper];
|
|
501
|
+
const num = parseInt(token, 10);
|
|
502
|
+
if (!isNaN(num)) return num;
|
|
503
|
+
return null;
|
|
504
|
+
}
|
|
505
|
+
function parseCronFieldPart(part, min, max, nameMap) {
|
|
506
|
+
if (part.startsWith("*/")) {
|
|
507
|
+
const step = parseInt(part.slice(2), 10);
|
|
508
|
+
if (isNaN(step) || step < 1) return { error: `Invalid step in "${part}"` };
|
|
509
|
+
const vals = [];
|
|
510
|
+
for (let i = min; i <= max; i += step) vals.push(i);
|
|
511
|
+
return vals;
|
|
512
|
+
}
|
|
513
|
+
if (part.includes("-")) {
|
|
514
|
+
const stepSplit = part.split("/");
|
|
515
|
+
const rangePart = stepSplit[0];
|
|
516
|
+
const step = stepSplit.length > 1 ? parseInt(stepSplit[1], 10) : 1;
|
|
517
|
+
if (isNaN(step) || step < 1) return { error: `Invalid step in "${part}"` };
|
|
518
|
+
const [startStr, endStr] = rangePart.split("-");
|
|
519
|
+
const start = resolveNamedValue(startStr, nameMap);
|
|
520
|
+
const end = resolveNamedValue(endStr, nameMap);
|
|
521
|
+
if (start === null || end === null) return { error: `Invalid range in "${part}"` };
|
|
522
|
+
if (start < min || end > max || start > end) return { error: `Range out of bounds in "${part}"` };
|
|
523
|
+
const vals = [];
|
|
524
|
+
for (let i = start; i <= end; i += step) vals.push(i);
|
|
525
|
+
return vals;
|
|
526
|
+
}
|
|
527
|
+
if (part.includes("/")) {
|
|
528
|
+
const [startStr, stepStr] = part.split("/");
|
|
529
|
+
const start = resolveNamedValue(startStr, nameMap);
|
|
530
|
+
const step = parseInt(stepStr, 10);
|
|
531
|
+
if (start === null || isNaN(step) || step < 1) return { error: `Invalid expression "${part}"` };
|
|
532
|
+
if (start < min || start > max) return { error: `Value out of bounds in "${part}"` };
|
|
533
|
+
const vals = [];
|
|
534
|
+
for (let i = start; i <= max; i += step) vals.push(i);
|
|
535
|
+
return vals;
|
|
536
|
+
}
|
|
537
|
+
const val = resolveNamedValue(part, nameMap);
|
|
538
|
+
if (val === null) return { error: `Invalid value "${part}"` };
|
|
539
|
+
if (val < min || val > max) return { error: `Value ${val} out of bounds [${min}-${max}]` };
|
|
540
|
+
return [val];
|
|
541
|
+
}
|
|
542
|
+
function parseCronNextField(raw, min, max, nameMap = {}) {
|
|
543
|
+
if (raw === "*") {
|
|
544
|
+
const values2 = [];
|
|
545
|
+
for (let i = min; i <= max; i++) values2.push(i);
|
|
546
|
+
return { raw, values: values2, min, max };
|
|
547
|
+
}
|
|
548
|
+
const parts = raw.split(",");
|
|
549
|
+
const allValues = /* @__PURE__ */ new Set();
|
|
550
|
+
for (const part of parts) {
|
|
551
|
+
const result = parseCronFieldPart(part.trim(), min, max, nameMap);
|
|
552
|
+
if (typeof result === "object" && "error" in result) return result;
|
|
553
|
+
for (const v of result) allValues.add(v);
|
|
554
|
+
}
|
|
555
|
+
const values = Array.from(allValues).sort((a, b) => a - b);
|
|
556
|
+
return { raw, values, min, max };
|
|
557
|
+
}
|
|
558
|
+
function parseCronExpression(expr) {
|
|
559
|
+
const trimmed = expr.trim();
|
|
560
|
+
const fields = trimmed.split(/\s+/);
|
|
561
|
+
if (fields.length < 5) return { error: "Cron expression must have exactly 5 fields" };
|
|
562
|
+
if (fields.length > 5) return { error: "Cron expression must have exactly 5 fields (6+ field expressions not supported)" };
|
|
563
|
+
const [minRaw, hourRaw, domRaw, monRaw, dowRaw] = fields;
|
|
564
|
+
const minute = parseCronNextField(minRaw, 0, 59, {});
|
|
565
|
+
if (typeof minute === "object" && "error" in minute) return { error: `Minute field: ${minute.error}` };
|
|
566
|
+
const hour = parseCronNextField(hourRaw, 0, 23, {});
|
|
567
|
+
if (typeof hour === "object" && "error" in hour) return { error: `Hour field: ${hour.error}` };
|
|
568
|
+
const dayOfMonth = parseCronNextField(domRaw, 1, 31, {});
|
|
569
|
+
if (typeof dayOfMonth === "object" && "error" in dayOfMonth) return { error: `Day-of-month field: ${dayOfMonth.error}` };
|
|
570
|
+
const month = parseCronNextField(monRaw, 1, 12, CRON_NEXT_MONTH_NAMES);
|
|
571
|
+
if (typeof month === "object" && "error" in month) return { error: `Month field: ${month.error}` };
|
|
572
|
+
const dayOfWeek = parseCronNextField(dowRaw, 0, 6, CRON_NEXT_WEEKDAY_NAMES);
|
|
573
|
+
if (typeof dayOfWeek === "object" && "error" in dayOfWeek) return { error: `Day-of-week field: ${dayOfWeek.error}` };
|
|
574
|
+
return {
|
|
575
|
+
minute,
|
|
576
|
+
hour,
|
|
577
|
+
dayOfMonth,
|
|
578
|
+
month,
|
|
579
|
+
dayOfWeek
|
|
580
|
+
};
|
|
581
|
+
}
|
|
582
|
+
function matchesCron(date, parsed) {
|
|
583
|
+
const min = date.getMinutes();
|
|
584
|
+
const hour = date.getHours();
|
|
585
|
+
const dom = date.getDate();
|
|
586
|
+
const month = date.getMonth() + 1;
|
|
587
|
+
const dow = date.getDay();
|
|
588
|
+
if (!parsed.minute.values.includes(min)) return false;
|
|
589
|
+
if (!parsed.hour.values.includes(hour)) return false;
|
|
590
|
+
if (!parsed.month.values.includes(month)) return false;
|
|
591
|
+
const domWild = parsed.dayOfMonth.raw === "*";
|
|
592
|
+
const dowWild = parsed.dayOfWeek.raw === "*";
|
|
593
|
+
if (domWild && dowWild) return true;
|
|
594
|
+
if (domWild) return parsed.dayOfWeek.values.includes(dow);
|
|
595
|
+
if (dowWild) return parsed.dayOfMonth.values.includes(dom);
|
|
596
|
+
return parsed.dayOfMonth.values.includes(dom) || parsed.dayOfWeek.values.includes(dow);
|
|
597
|
+
}
|
|
598
|
+
function getNextRuns(expr, count = 10, fromDate) {
|
|
599
|
+
if (count > 100) return { error: "count must be 100 or less" };
|
|
600
|
+
const parsed = parseCronExpression(expr);
|
|
601
|
+
if (typeof parsed === "object" && "error" in parsed) return parsed;
|
|
602
|
+
const results = [];
|
|
603
|
+
const start = fromDate ? new Date(fromDate) : /* @__PURE__ */ new Date();
|
|
604
|
+
const cursor = new Date(start);
|
|
605
|
+
cursor.setSeconds(0, 0);
|
|
606
|
+
cursor.setMinutes(cursor.getMinutes() + 1);
|
|
607
|
+
const maxMinutes = 5 * 365 * 24 * 60;
|
|
608
|
+
let checked = 0;
|
|
609
|
+
while (results.length < count && checked < maxMinutes) {
|
|
610
|
+
if (matchesCron(cursor, parsed)) {
|
|
611
|
+
results.push(new Date(cursor));
|
|
612
|
+
}
|
|
613
|
+
cursor.setMinutes(cursor.getMinutes() + 1);
|
|
614
|
+
checked++;
|
|
615
|
+
}
|
|
616
|
+
if (results.length === 0) {
|
|
617
|
+
return { error: "No runs found in the next 5 years for this expression" };
|
|
618
|
+
}
|
|
619
|
+
return results;
|
|
620
|
+
}
|
|
621
|
+
function formatRunDate(date, timezone) {
|
|
622
|
+
const year = date.getFullYear();
|
|
623
|
+
const month = String(date.getMonth() + 1).padStart(2, "0");
|
|
624
|
+
const day = String(date.getDate()).padStart(2, "0");
|
|
625
|
+
const hours = String(date.getHours()).padStart(2, "0");
|
|
626
|
+
const minutes = String(date.getMinutes()).padStart(2, "0");
|
|
627
|
+
const seconds = String(date.getSeconds()).padStart(2, "0");
|
|
628
|
+
const dayName = DAY_NAMES[date.getDay()];
|
|
629
|
+
const base = `${year}-${month}-${day} ${hours}:${minutes}:${seconds} (${dayName})`;
|
|
630
|
+
return timezone ? `${base} ${timezone}` : base;
|
|
631
|
+
}
|
|
632
|
+
function getRunInterval(dates) {
|
|
633
|
+
if (dates.length < 2) return "Unknown interval";
|
|
634
|
+
const diffMs = dates[1].getTime() - dates[0].getTime();
|
|
635
|
+
const diffMins = Math.round(diffMs / 6e4);
|
|
636
|
+
if (diffMins === 1) return "Every minute";
|
|
637
|
+
if (diffMins < 60) return `Every ${diffMins} minutes`;
|
|
638
|
+
if (diffMins === 60) {
|
|
639
|
+
const min = dates[0].getMinutes();
|
|
640
|
+
return min === 0 ? "Every hour" : `Every hour at :${String(min).padStart(2, "0")}`;
|
|
641
|
+
}
|
|
642
|
+
if (diffMins < 1440) {
|
|
643
|
+
const hours = diffMins / 60;
|
|
644
|
+
if (Number.isInteger(hours)) {
|
|
645
|
+
return `Every ${hours} hours`;
|
|
646
|
+
}
|
|
647
|
+
return `Every ${diffMins} minutes`;
|
|
648
|
+
}
|
|
649
|
+
if (diffMins === 1440) {
|
|
650
|
+
const h = dates[0].getHours();
|
|
651
|
+
const m = dates[0].getMinutes();
|
|
652
|
+
const timeStr = `${String(h).padStart(2, "0")}:${String(m).padStart(2, "0")}`;
|
|
653
|
+
return `Every day at ${timeStr}`;
|
|
654
|
+
}
|
|
655
|
+
if (diffMins === 7 * 1440) {
|
|
656
|
+
const dayName = DAY_NAMES[dates[0].getDay()];
|
|
657
|
+
return `Every ${dayName}`;
|
|
658
|
+
}
|
|
659
|
+
const days = Math.round(diffMins / 1440);
|
|
660
|
+
return `Every ${days} days`;
|
|
661
|
+
}
|
|
662
|
+
|
|
663
|
+
exports.COMMON_CRONS = COMMON_CRONS;
|
|
664
|
+
exports.COMMON_DATE_PRESETS = COMMON_DATE_PRESETS;
|
|
665
|
+
exports.TIMEZONES = TIMEZONES;
|
|
666
|
+
exports.convertTime = convertTime;
|
|
667
|
+
exports.diffDates = diffDates;
|
|
668
|
+
exports.formatInTimezone = formatInTimezone;
|
|
669
|
+
exports.formatRelative = formatRelative;
|
|
670
|
+
exports.formatRunDate = formatRunDate;
|
|
671
|
+
exports.fromIsoString = fromIsoString;
|
|
672
|
+
exports.fromUnix = fromUnix;
|
|
673
|
+
exports.getAllZonesForTime = getAllZonesForTime;
|
|
674
|
+
exports.getNextRuns = getNextRuns;
|
|
675
|
+
exports.getNow = getNow;
|
|
676
|
+
exports.getRunInterval = getRunInterval;
|
|
677
|
+
exports.getTimezoneOffset = getTimezoneOffset;
|
|
678
|
+
exports.humanizeDiff = humanizeDiff;
|
|
679
|
+
exports.parseCron = parseCron;
|
|
680
|
+
exports.parseCronExpression = parseCronExpression;
|
|
681
|
+
exports.parseDate = parseDate;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { C as COMMON_CRONS, a as COMMON_DATE_PRESETS, b as CronField, c as CronNextField, d as CronResult, D as DateDiffResult, P as ParsedCron, T as TIMEZONES, e as TimestampResult, f as TimezoneEntry, g as convertTime, h as diffDates, i as formatInTimezone, j as formatRelative, k as formatRunDate, l as fromIsoString, m as fromUnix, n as getAllZonesForTime, o as getNextRuns, p as getNow, q as getRunInterval, r as getTimezoneOffset, s as humanizeDiff, u as parseCron, v as parseCronExpression, w as parseDate } from '../time-DbT8fjaF.cjs';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { C as COMMON_CRONS, a as COMMON_DATE_PRESETS, b as CronField, c as CronNextField, d as CronResult, D as DateDiffResult, P as ParsedCron, T as TIMEZONES, e as TimestampResult, f as TimezoneEntry, g as convertTime, h as diffDates, i as formatInTimezone, j as formatRelative, k as formatRunDate, l as fromIsoString, m as fromUnix, n as getAllZonesForTime, o as getNextRuns, p as getNow, q as getRunInterval, r as getTimezoneOffset, s as humanizeDiff, u as parseCron, v as parseCronExpression, w as parseDate } from '../time-DbT8fjaF.js';
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { COMMON_CRONS, COMMON_DATE_PRESETS, TIMEZONES, convertTime, diffDates, formatInTimezone, formatRelative, formatRunDate, fromIsoString, fromUnix, getAllZonesForTime, getNextRuns, getNow, getRunInterval, getTimezoneOffset, humanizeDiff, parseCron, parseCronExpression, parseDate } from '../chunk-ZPQZEIXP.js';
|
|
2
|
+
import '../chunk-MLKGABMK.js';
|