yummies 7.10.0 → 7.12.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/async.cjs +162 -48
- package/async.cjs.map +1 -1
- package/async.d.ts +112 -13
- package/async.js +163 -54
- package/async.js.map +1 -1
- package/chunk-CVq3Gv4J.cjs +50 -0
- package/chunk-YKewjYmz.js +37 -0
- package/common.cjs +48 -8
- package/common.cjs.map +1 -1
- package/common.d.ts +35 -2
- package/common.js +49 -11
- package/common.js.map +1 -1
- package/complex.cjs +275 -104
- package/complex.cjs.map +1 -1
- package/complex.d.ts +133 -13
- package/complex.js +275 -109
- package/complex.js.map +1 -1
- package/cookie.cjs +17 -7
- package/cookie.cjs.map +1 -1
- package/cookie.d.ts +8 -0
- package/cookie.js +18 -9
- package/cookie.js.map +1 -1
- package/css.cjs +147 -39
- package/css.cjs.map +1 -1
- package/css.d.ts +98 -6
- package/css.js +143 -41
- package/css.js.map +1 -1
- package/data.cjs +90 -55
- package/data.cjs.map +1 -1
- package/data.d.ts +32 -0
- package/data.js +91 -61
- package/data.js.map +1 -1
- package/date-time.cjs +578 -412
- package/date-time.cjs.map +1 -1
- package/date-time.d.ts +88 -0
- package/date-time.js +575 -421
- package/date-time.js.map +1 -1
- package/device.cjs +48 -23
- package/device.cjs.map +1 -1
- package/device.d.ts +32 -0
- package/device.js +49 -31
- package/device.js.map +1 -1
- package/encodings.cjs +275 -266
- package/encodings.cjs.map +1 -1
- package/encodings.d.ts +8 -0
- package/encodings.js +276 -268
- package/encodings.js.map +1 -1
- package/errors.cjs +20 -18
- package/errors.cjs.map +1 -1
- package/errors.js +19 -19
- package/errors.js.map +1 -1
- package/file.cjs +42 -24
- package/file.cjs.map +1 -1
- package/file.d.ts +16 -0
- package/file.js +43 -27
- package/file.js.map +1 -1
- package/format.cjs +125 -83
- package/format.cjs.map +1 -1
- package/format.d.ts +89 -4
- package/format.js +118 -82
- package/format.js.map +1 -1
- package/html.cjs +226 -137
- package/html.cjs.map +1 -1
- package/html.d.ts +67 -3
- package/html.js +223 -150
- package/html.js.map +1 -1
- package/id.cjs +74 -17
- package/id.cjs.map +1 -1
- package/id.d.ts +10 -10
- package/id.js +73 -24
- package/id.js.map +1 -1
- package/imports.cjs +41 -29
- package/imports.cjs.map +1 -1
- package/imports.d.ts +13 -4
- package/imports.js +40 -31
- package/imports.js.map +1 -1
- package/math.cjs +32 -6
- package/math.cjs.map +1 -1
- package/math.d.ts +17 -1
- package/math.js +33 -10
- package/math.js.map +1 -1
- package/media.cjs +275 -84
- package/media.cjs.map +1 -1
- package/media.d.ts +188 -2
- package/media.js +274 -93
- package/media.js.map +1 -1
- package/mobx.cjs +353 -193
- package/mobx.cjs.map +1 -1
- package/mobx.d.ts +172 -6
- package/mobx.js +351 -200
- package/mobx.js.map +1 -1
- package/ms.cjs +21 -10
- package/ms.cjs.map +1 -1
- package/ms.d.ts +1 -1
- package/ms.js +22 -13
- package/ms.js.map +1 -1
- package/number.cjs +13 -7
- package/number.cjs.map +1 -1
- package/number.js +14 -9
- package/number.js.map +1 -1
- package/package.json +13 -5
- package/parser.cjs +117 -64
- package/parser.cjs.map +1 -1
- package/parser.d.ts +63 -0
- package/parser.js +111 -64
- package/parser.js.map +1 -1
- package/price.cjs +24 -18
- package/price.cjs.map +1 -1
- package/price.d.ts +8 -0
- package/price.js +25 -20
- package/price.js.map +1 -1
- package/random.cjs +79 -13
- package/random.cjs.map +1 -1
- package/random.d.ts +64 -0
- package/random.js +80 -22
- package/random.js.map +1 -1
- package/react.cjs +673 -214
- package/react.cjs.map +1 -1
- package/react.d.ts +428 -9
- package/react.js +674 -239
- package/react.js.map +1 -1
- package/sound.cjs +14 -9
- package/sound.cjs.map +1 -1
- package/sound.d.ts +1 -1
- package/sound.js +15 -11
- package/sound.js.map +1 -1
- package/storage.cjs +49 -50
- package/storage.cjs.map +1 -1
- package/storage.d.ts +15 -6
- package/storage.js +50 -53
- package/storage.js.map +1 -1
- package/text.cjs +51 -34
- package/text.cjs.map +1 -1
- package/text.d.ts +5 -5
- package/text.js +52 -37
- package/text.js.map +1 -1
- package/type-guard.cjs +292 -72
- package/type-guard.cjs.map +1 -1
- package/type-guard.d.ts +199 -42
- package/type-guard.js +288 -73
- package/type-guard.js.map +1 -1
- package/types.cjs +0 -2
- package/types.global.cjs +0 -2
- package/types.global.js +0 -2
- package/types.js +0 -2
- package/vibrate.cjs +31 -6
- package/vibrate.cjs.map +1 -1
- package/vibrate.d.ts +23 -1
- package/vibrate.js +32 -8
- package/vibrate.js.map +1 -1
- package/types.cjs.map +0 -1
- package/types.global.cjs.map +0 -1
- package/types.global.js.map +0 -1
- package/types.js.map +0 -1
package/date-time.cjs
CHANGED
|
@@ -1,424 +1,589 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
var
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
var
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
2
|
+
const require_chunk = require("./chunk-CVq3Gv4J.cjs");
|
|
3
|
+
let yummies_type_guard = require("yummies/type-guard");
|
|
4
|
+
let yummies_format = require("yummies/format");
|
|
5
|
+
let dayjs = require("dayjs");
|
|
6
|
+
dayjs = require_chunk.__toESM(dayjs);
|
|
7
|
+
let yummies_ms = require("yummies/ms");
|
|
8
|
+
let yummies_text = require("yummies/text");
|
|
9
|
+
//#region node_modules/.pnpm/dayjs@1.11.20/node_modules/dayjs/plugin/duration.js
|
|
10
|
+
var require_duration = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, module) => {
|
|
11
|
+
(function(t, s) {
|
|
12
|
+
"object" == typeof exports && "undefined" != typeof module ? module.exports = s() : "function" == typeof define && define.amd ? define(s) : (t = "undefined" != typeof globalThis ? globalThis : t || self).dayjs_plugin_duration = s();
|
|
13
|
+
})(exports, (function() {
|
|
14
|
+
"use strict";
|
|
15
|
+
var t, s, n = 1e3, i = 6e4, e = 36e5, r = 864e5, o = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, u = 31536e6, d = 2628e6, a = /^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/, h = {
|
|
16
|
+
years: u,
|
|
17
|
+
months: d,
|
|
18
|
+
days: r,
|
|
19
|
+
hours: e,
|
|
20
|
+
minutes: i,
|
|
21
|
+
seconds: n,
|
|
22
|
+
milliseconds: 1,
|
|
23
|
+
weeks: 6048e5
|
|
24
|
+
}, c = function(t) {
|
|
25
|
+
return t instanceof g;
|
|
26
|
+
}, f = function(t, s, n) {
|
|
27
|
+
return new g(t, n, s.$l);
|
|
28
|
+
}, m = function(t) {
|
|
29
|
+
return s.p(t) + "s";
|
|
30
|
+
}, l = function(t) {
|
|
31
|
+
return t < 0;
|
|
32
|
+
}, $ = function(t) {
|
|
33
|
+
return l(t) ? Math.ceil(t) : Math.floor(t);
|
|
34
|
+
}, y = function(t) {
|
|
35
|
+
return Math.abs(t);
|
|
36
|
+
}, v = function(t, s) {
|
|
37
|
+
return t ? l(t) ? {
|
|
38
|
+
negative: !0,
|
|
39
|
+
format: "" + y(t) + s
|
|
40
|
+
} : {
|
|
41
|
+
negative: !1,
|
|
42
|
+
format: "" + t + s
|
|
43
|
+
} : {
|
|
44
|
+
negative: !1,
|
|
45
|
+
format: ""
|
|
46
|
+
};
|
|
47
|
+
}, g = function() {
|
|
48
|
+
function l(t, s, n) {
|
|
49
|
+
var i = this;
|
|
50
|
+
if (this.$d = {}, this.$l = n, void 0 === t && (this.$ms = 0, this.parseFromMilliseconds()), s) return f(t * h[m(s)], this);
|
|
51
|
+
if ("number" == typeof t) return this.$ms = t, this.parseFromMilliseconds(), this;
|
|
52
|
+
if ("object" == typeof t) return Object.keys(t).forEach((function(s) {
|
|
53
|
+
i.$d[m(s)] = t[s];
|
|
54
|
+
})), this.calMilliseconds(), this;
|
|
55
|
+
if ("string" == typeof t) {
|
|
56
|
+
var e = t.match(a);
|
|
57
|
+
if (e) {
|
|
58
|
+
var r = e.slice(2).map((function(t) {
|
|
59
|
+
return null != t ? Number(t) : 0;
|
|
60
|
+
}));
|
|
61
|
+
return this.$d.years = r[0], this.$d.months = r[1], this.$d.weeks = r[2], this.$d.days = r[3], this.$d.hours = r[4], this.$d.minutes = r[5], this.$d.seconds = r[6], this.calMilliseconds(), this;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
return this;
|
|
65
|
+
}
|
|
66
|
+
var y = l.prototype;
|
|
67
|
+
return y.calMilliseconds = function() {
|
|
68
|
+
var t = this;
|
|
69
|
+
this.$ms = Object.keys(this.$d).reduce((function(s, n) {
|
|
70
|
+
return s + (t.$d[n] || 0) * h[n];
|
|
71
|
+
}), 0);
|
|
72
|
+
}, y.parseFromMilliseconds = function() {
|
|
73
|
+
var t = this.$ms;
|
|
74
|
+
this.$d.years = $(t / u), t %= u, this.$d.months = $(t / d), t %= d, this.$d.days = $(t / r), t %= r, this.$d.hours = $(t / e), t %= e, this.$d.minutes = $(t / i), t %= i, this.$d.seconds = $(t / n), t %= n, this.$d.milliseconds = t;
|
|
75
|
+
}, y.toISOString = function() {
|
|
76
|
+
var t = v(this.$d.years, "Y"), s = v(this.$d.months, "M"), n = +this.$d.days || 0;
|
|
77
|
+
this.$d.weeks && (n += 7 * this.$d.weeks);
|
|
78
|
+
var i = v(n, "D"), e = v(this.$d.hours, "H"), r = v(this.$d.minutes, "M"), o = this.$d.seconds || 0;
|
|
79
|
+
this.$d.milliseconds && (o += this.$d.milliseconds / 1e3, o = Math.round(1e3 * o) / 1e3);
|
|
80
|
+
var u = v(o, "S"), d = t.negative || s.negative || i.negative || e.negative || r.negative || u.negative, a = e.format || r.format || u.format ? "T" : "", h = (d ? "-" : "") + "P" + t.format + s.format + i.format + a + e.format + r.format + u.format;
|
|
81
|
+
return "P" === h || "-P" === h ? "P0D" : h;
|
|
82
|
+
}, y.toJSON = function() {
|
|
83
|
+
return this.toISOString();
|
|
84
|
+
}, y.format = function(t) {
|
|
85
|
+
var n = t || "YYYY-MM-DDTHH:mm:ss", i = {
|
|
86
|
+
Y: this.$d.years,
|
|
87
|
+
YY: s.s(this.$d.years, 2, "0"),
|
|
88
|
+
YYYY: s.s(this.$d.years, 4, "0"),
|
|
89
|
+
M: this.$d.months,
|
|
90
|
+
MM: s.s(this.$d.months, 2, "0"),
|
|
91
|
+
D: this.$d.days,
|
|
92
|
+
DD: s.s(this.$d.days, 2, "0"),
|
|
93
|
+
H: this.$d.hours,
|
|
94
|
+
HH: s.s(this.$d.hours, 2, "0"),
|
|
95
|
+
m: this.$d.minutes,
|
|
96
|
+
mm: s.s(this.$d.minutes, 2, "0"),
|
|
97
|
+
s: this.$d.seconds,
|
|
98
|
+
ss: s.s(this.$d.seconds, 2, "0"),
|
|
99
|
+
SSS: s.s(this.$d.milliseconds, 3, "0")
|
|
100
|
+
};
|
|
101
|
+
return n.replace(o, (function(t, s) {
|
|
102
|
+
return s || String(i[t]);
|
|
103
|
+
}));
|
|
104
|
+
}, y.as = function(t) {
|
|
105
|
+
return this.$ms / h[m(t)];
|
|
106
|
+
}, y.get = function(t) {
|
|
107
|
+
var s = this.$ms, n = m(t);
|
|
108
|
+
return "milliseconds" === n ? s %= 1e3 : s = "weeks" === n ? $(s / h[n]) : this.$d[n], s || 0;
|
|
109
|
+
}, y.add = function(t, s, n) {
|
|
110
|
+
var i;
|
|
111
|
+
return i = s ? t * h[m(s)] : c(t) ? t.$ms : f(t, this).$ms, f(this.$ms + i * (n ? -1 : 1), this);
|
|
112
|
+
}, y.subtract = function(t, s) {
|
|
113
|
+
return this.add(t, s, !0);
|
|
114
|
+
}, y.locale = function(t) {
|
|
115
|
+
var s = this.clone();
|
|
116
|
+
return s.$l = t, s;
|
|
117
|
+
}, y.clone = function() {
|
|
118
|
+
return f(this.$ms, this);
|
|
119
|
+
}, y.humanize = function(s) {
|
|
120
|
+
return t().add(this.$ms, "ms").locale(this.$l).fromNow(!s);
|
|
121
|
+
}, y.valueOf = function() {
|
|
122
|
+
return this.asMilliseconds();
|
|
123
|
+
}, y.milliseconds = function() {
|
|
124
|
+
return this.get("milliseconds");
|
|
125
|
+
}, y.asMilliseconds = function() {
|
|
126
|
+
return this.as("milliseconds");
|
|
127
|
+
}, y.seconds = function() {
|
|
128
|
+
return this.get("seconds");
|
|
129
|
+
}, y.asSeconds = function() {
|
|
130
|
+
return this.as("seconds");
|
|
131
|
+
}, y.minutes = function() {
|
|
132
|
+
return this.get("minutes");
|
|
133
|
+
}, y.asMinutes = function() {
|
|
134
|
+
return this.as("minutes");
|
|
135
|
+
}, y.hours = function() {
|
|
136
|
+
return this.get("hours");
|
|
137
|
+
}, y.asHours = function() {
|
|
138
|
+
return this.as("hours");
|
|
139
|
+
}, y.days = function() {
|
|
140
|
+
return this.get("days");
|
|
141
|
+
}, y.asDays = function() {
|
|
142
|
+
return this.as("days");
|
|
143
|
+
}, y.weeks = function() {
|
|
144
|
+
return this.get("weeks");
|
|
145
|
+
}, y.asWeeks = function() {
|
|
146
|
+
return this.as("weeks");
|
|
147
|
+
}, y.months = function() {
|
|
148
|
+
return this.get("months");
|
|
149
|
+
}, y.asMonths = function() {
|
|
150
|
+
return this.as("months");
|
|
151
|
+
}, y.years = function() {
|
|
152
|
+
return this.get("years");
|
|
153
|
+
}, y.asYears = function() {
|
|
154
|
+
return this.as("years");
|
|
155
|
+
}, l;
|
|
156
|
+
}(), p = function(t, s, n) {
|
|
157
|
+
return t.add(s.years() * n, "y").add(s.months() * n, "M").add(s.days() * n, "d").add(s.hours() * n, "h").add(s.minutes() * n, "m").add(s.seconds() * n, "s").add(s.milliseconds() * n, "ms");
|
|
158
|
+
};
|
|
159
|
+
return function(n, i, e) {
|
|
160
|
+
t = e, s = e().$utils(), e.duration = function(t, s) {
|
|
161
|
+
return f(t, { $l: e.locale() }, s);
|
|
162
|
+
}, e.isDuration = c;
|
|
163
|
+
var r = i.prototype.add, o = i.prototype.subtract;
|
|
164
|
+
i.prototype.add = function(t, s) {
|
|
165
|
+
return c(t) ? p(this, t, 1) : r.bind(this)(t, s);
|
|
166
|
+
}, i.prototype.subtract = function(t, s) {
|
|
167
|
+
return c(t) ? p(this, t, -1) : o.bind(this)(t, s);
|
|
168
|
+
};
|
|
169
|
+
};
|
|
170
|
+
}));
|
|
171
|
+
}));
|
|
172
|
+
//#endregion
|
|
173
|
+
//#region node_modules/.pnpm/dayjs@1.11.20/node_modules/dayjs/plugin/relativeTime.js
|
|
174
|
+
var require_relativeTime = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, module) => {
|
|
175
|
+
(function(r, e) {
|
|
176
|
+
"object" == typeof exports && "undefined" != typeof module ? module.exports = e() : "function" == typeof define && define.amd ? define(e) : (r = "undefined" != typeof globalThis ? globalThis : r || self).dayjs_plugin_relativeTime = e();
|
|
177
|
+
})(exports, (function() {
|
|
178
|
+
"use strict";
|
|
179
|
+
return function(r, e, t) {
|
|
180
|
+
r = r || {};
|
|
181
|
+
var n = e.prototype, o = {
|
|
182
|
+
future: "in %s",
|
|
183
|
+
past: "%s ago",
|
|
184
|
+
s: "a few seconds",
|
|
185
|
+
m: "a minute",
|
|
186
|
+
mm: "%d minutes",
|
|
187
|
+
h: "an hour",
|
|
188
|
+
hh: "%d hours",
|
|
189
|
+
d: "a day",
|
|
190
|
+
dd: "%d days",
|
|
191
|
+
M: "a month",
|
|
192
|
+
MM: "%d months",
|
|
193
|
+
y: "a year",
|
|
194
|
+
yy: "%d years"
|
|
195
|
+
};
|
|
196
|
+
function i(r, e, t, o) {
|
|
197
|
+
return n.fromToBase(r, e, t, o);
|
|
198
|
+
}
|
|
199
|
+
t.en.relativeTime = o, n.fromToBase = function(e, n, i, d, u) {
|
|
200
|
+
for (var f, a, s, l = i.$locale().relativeTime || o, h = r.thresholds || [
|
|
201
|
+
{
|
|
202
|
+
l: "s",
|
|
203
|
+
r: 44,
|
|
204
|
+
d: "second"
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
l: "m",
|
|
208
|
+
r: 89
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
l: "mm",
|
|
212
|
+
r: 44,
|
|
213
|
+
d: "minute"
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
l: "h",
|
|
217
|
+
r: 89
|
|
218
|
+
},
|
|
219
|
+
{
|
|
220
|
+
l: "hh",
|
|
221
|
+
r: 21,
|
|
222
|
+
d: "hour"
|
|
223
|
+
},
|
|
224
|
+
{
|
|
225
|
+
l: "d",
|
|
226
|
+
r: 35
|
|
227
|
+
},
|
|
228
|
+
{
|
|
229
|
+
l: "dd",
|
|
230
|
+
r: 25,
|
|
231
|
+
d: "day"
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
l: "M",
|
|
235
|
+
r: 45
|
|
236
|
+
},
|
|
237
|
+
{
|
|
238
|
+
l: "MM",
|
|
239
|
+
r: 10,
|
|
240
|
+
d: "month"
|
|
241
|
+
},
|
|
242
|
+
{
|
|
243
|
+
l: "y",
|
|
244
|
+
r: 17
|
|
245
|
+
},
|
|
246
|
+
{
|
|
247
|
+
l: "yy",
|
|
248
|
+
d: "year"
|
|
249
|
+
}
|
|
250
|
+
], m = h.length, c = 0; c < m; c += 1) {
|
|
251
|
+
var y = h[c];
|
|
252
|
+
y.d && (f = d ? t(e).diff(i, y.d, !0) : i.diff(e, y.d, !0));
|
|
253
|
+
var p = (r.rounding || Math.round)(Math.abs(f));
|
|
254
|
+
if (s = f > 0, p <= y.r || !y.r) {
|
|
255
|
+
p <= 1 && c > 0 && (y = h[c - 1]);
|
|
256
|
+
var v = l[y.l];
|
|
257
|
+
u && (p = u("" + p)), a = "string" == typeof v ? v.replace("%d", p) : v(p, n, y.l, s);
|
|
258
|
+
break;
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
if (n) return a;
|
|
262
|
+
var M = s ? l.future : l.past;
|
|
263
|
+
return "function" == typeof M ? M(a) : M.replace("%s", a);
|
|
264
|
+
}, n.to = function(r, e) {
|
|
265
|
+
return i(r, e, this, !0);
|
|
266
|
+
}, n.from = function(r, e) {
|
|
267
|
+
return i(r, e, this);
|
|
268
|
+
};
|
|
269
|
+
var d = function(r) {
|
|
270
|
+
return r.$u ? t.utc() : t();
|
|
271
|
+
};
|
|
272
|
+
n.toNow = function(r) {
|
|
273
|
+
return this.to(d(this), r);
|
|
274
|
+
}, n.fromNow = function(r) {
|
|
275
|
+
return this.from(d(this), r);
|
|
276
|
+
};
|
|
277
|
+
};
|
|
278
|
+
}));
|
|
279
|
+
}));
|
|
280
|
+
//#endregion
|
|
281
|
+
//#region node_modules/.pnpm/dayjs@1.11.20/node_modules/dayjs/locale/ru.js
|
|
282
|
+
var require_ru = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, module) => {
|
|
283
|
+
(function(_, t) {
|
|
284
|
+
"object" == typeof exports && "undefined" != typeof module ? module.exports = t(require("dayjs")) : "function" == typeof define && define.amd ? define(["dayjs"], t) : (_ = "undefined" != typeof globalThis ? globalThis : _ || self).dayjs_locale_ru = t(_.dayjs);
|
|
285
|
+
})(exports, (function(_) {
|
|
286
|
+
"use strict";
|
|
287
|
+
function t(_) {
|
|
288
|
+
return _ && "object" == typeof _ && "default" in _ ? _ : { default: _ };
|
|
289
|
+
}
|
|
290
|
+
var e = t(_), n = "января_февраля_марта_апреля_мая_июня_июля_августа_сентября_октября_ноября_декабря".split("_"), s = "январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь".split("_"), r = "янв._февр._мар._апр._мая_июня_июля_авг._сент._окт._нояб._дек.".split("_"), o = "янв._февр._март_апр._май_июнь_июль_авг._сент._окт._нояб._дек.".split("_"), i = /D[oD]?(\[[^[\]]*\]|\s)+MMMM?/;
|
|
291
|
+
function d(_, t, e) {
|
|
292
|
+
var n, s;
|
|
293
|
+
return "m" === e ? t ? "минута" : "минуту" : _ + " " + (n = +_, s = {
|
|
294
|
+
mm: t ? "минута_минуты_минут" : "минуту_минуты_минут",
|
|
295
|
+
hh: "час_часа_часов",
|
|
296
|
+
dd: "день_дня_дней",
|
|
297
|
+
MM: "месяц_месяца_месяцев",
|
|
298
|
+
yy: "год_года_лет"
|
|
299
|
+
}[e].split("_"), n % 10 == 1 && n % 100 != 11 ? s[0] : n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 10 || n % 100 >= 20) ? s[1] : s[2]);
|
|
300
|
+
}
|
|
301
|
+
var u = function(_, t) {
|
|
302
|
+
return i.test(t) ? n[_.month()] : s[_.month()];
|
|
303
|
+
};
|
|
304
|
+
u.s = s, u.f = n;
|
|
305
|
+
var a = function(_, t) {
|
|
306
|
+
return i.test(t) ? r[_.month()] : o[_.month()];
|
|
307
|
+
};
|
|
308
|
+
a.s = o, a.f = r;
|
|
309
|
+
var m = {
|
|
310
|
+
name: "ru",
|
|
311
|
+
weekdays: "воскресенье_понедельник_вторник_среда_четверг_пятница_суббота".split("_"),
|
|
312
|
+
weekdaysShort: "вск_пнд_втр_срд_чтв_птн_сбт".split("_"),
|
|
313
|
+
weekdaysMin: "вс_пн_вт_ср_чт_пт_сб".split("_"),
|
|
314
|
+
months: u,
|
|
315
|
+
monthsShort: a,
|
|
316
|
+
weekStart: 1,
|
|
317
|
+
yearStart: 4,
|
|
318
|
+
formats: {
|
|
319
|
+
LT: "H:mm",
|
|
320
|
+
LTS: "H:mm:ss",
|
|
321
|
+
L: "DD.MM.YYYY",
|
|
322
|
+
LL: "D MMMM YYYY г.",
|
|
323
|
+
LLL: "D MMMM YYYY г., H:mm",
|
|
324
|
+
LLLL: "dddd, D MMMM YYYY г., H:mm"
|
|
325
|
+
},
|
|
326
|
+
relativeTime: {
|
|
327
|
+
future: "через %s",
|
|
328
|
+
past: "%s назад",
|
|
329
|
+
s: "несколько секунд",
|
|
330
|
+
m: d,
|
|
331
|
+
mm: d,
|
|
332
|
+
h: "час",
|
|
333
|
+
hh: d,
|
|
334
|
+
d: "день",
|
|
335
|
+
dd: d,
|
|
336
|
+
M: "месяц",
|
|
337
|
+
MM: d,
|
|
338
|
+
y: "год",
|
|
339
|
+
yy: d
|
|
340
|
+
},
|
|
341
|
+
ordinal: function(_) {
|
|
342
|
+
return _;
|
|
343
|
+
},
|
|
344
|
+
meridiem: function(_) {
|
|
345
|
+
return _ < 4 ? "ночи" : _ < 12 ? "утра" : _ < 17 ? "дня" : "вечера";
|
|
346
|
+
}
|
|
347
|
+
};
|
|
348
|
+
return e.default.locale(m, null, !0), m;
|
|
349
|
+
}));
|
|
350
|
+
}));
|
|
351
|
+
//#endregion
|
|
352
|
+
//#region src/date-time.ts
|
|
353
|
+
var import_duration = /* @__PURE__ */ require_chunk.__toESM(require_duration(), 1);
|
|
354
|
+
var import_relativeTime = /* @__PURE__ */ require_chunk.__toESM(require_relativeTime(), 1);
|
|
355
|
+
require_ru();
|
|
356
|
+
dayjs.default.extend(import_relativeTime.default);
|
|
357
|
+
dayjs.default.extend(import_duration.default);
|
|
358
|
+
dayjs.default.locale("ru");
|
|
359
|
+
var toLibFormat = (value) => {
|
|
360
|
+
let result = null;
|
|
361
|
+
if (dayjs.default.isDayjs(value)) result = value;
|
|
362
|
+
else if (value != null) result = (0, dayjs.default)(value);
|
|
363
|
+
if (!result?.isValid()) return null;
|
|
364
|
+
return result;
|
|
252
365
|
};
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
return libDate.format("DD MMM HH:mm");
|
|
282
|
-
}
|
|
283
|
-
case "time": {
|
|
284
|
-
return libDate.format("HH:mm:ss");
|
|
285
|
-
}
|
|
286
|
-
case "time-short": {
|
|
287
|
-
return libDate.format("HH:mm");
|
|
288
|
-
}
|
|
289
|
-
case "day": {
|
|
290
|
-
return libDate.format("DD MMM YYYY");
|
|
291
|
-
}
|
|
292
|
-
case "month": {
|
|
293
|
-
return libDate.format("MMMM YYYY");
|
|
294
|
-
}
|
|
295
|
-
default: {
|
|
296
|
-
return libDate.format("DD.MM.YYYY");
|
|
297
|
-
}
|
|
298
|
-
}
|
|
366
|
+
/**
|
|
367
|
+
* Formats a date-like value using predefined presets or a custom pattern.
|
|
368
|
+
*
|
|
369
|
+
* @example
|
|
370
|
+
* ```ts
|
|
371
|
+
* formatDate('2024-03-15', { format: 'time-short' });
|
|
372
|
+
* ```
|
|
373
|
+
*/
|
|
374
|
+
var formatDate = (value, settings) => {
|
|
375
|
+
const dateFormat = settings?.format;
|
|
376
|
+
const datePattern = settings?.pattern;
|
|
377
|
+
const asTime = settings?.asTime;
|
|
378
|
+
let libDate = null;
|
|
379
|
+
if (asTime && yummies_type_guard.typeGuard.isNumber(value)) libDate = dayjs.default.duration(value);
|
|
380
|
+
else libDate = toLibFormat(value);
|
|
381
|
+
if (!libDate) return yummies_format.format.NO_VALUE;
|
|
382
|
+
if (datePattern) return libDate.format(datePattern);
|
|
383
|
+
if (dateFormat === "human" || dateFormat === "spent-time") if ("fromNow" in libDate) return libDate.fromNow(dateFormat === "spent-time");
|
|
384
|
+
else return yummies_format.format.NO_VALUE;
|
|
385
|
+
switch (dateFormat) {
|
|
386
|
+
case "full": return libDate.format("DD MMM YYYY HH:mm:ss");
|
|
387
|
+
case "short": return libDate.format("DD MMM HH:mm");
|
|
388
|
+
case "time": return libDate.format("HH:mm:ss");
|
|
389
|
+
case "time-short": return libDate.format("HH:mm");
|
|
390
|
+
case "day": return libDate.format("DD MMM YYYY");
|
|
391
|
+
case "month": return libDate.format("MMMM YYYY");
|
|
392
|
+
default: return libDate.format("DD.MM.YYYY");
|
|
393
|
+
}
|
|
299
394
|
};
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
395
|
+
/**
|
|
396
|
+
* Splits a duration in milliseconds into day-based time parts.
|
|
397
|
+
*
|
|
398
|
+
* @example
|
|
399
|
+
* ```ts
|
|
400
|
+
* dayTimeDuration(ms(1, 'day') + ms(2, 'hour'));
|
|
401
|
+
* ```
|
|
402
|
+
*/
|
|
403
|
+
var dayTimeDuration = (timeInMs) => {
|
|
404
|
+
let left = Math.max(timeInMs, 0);
|
|
405
|
+
const days = Math.floor(left / yummies_ms.unitsToMs.day);
|
|
406
|
+
left = left % yummies_ms.unitsToMs.day;
|
|
407
|
+
const hours = Math.floor(left / yummies_ms.unitsToMs.hour);
|
|
408
|
+
left = left % yummies_ms.unitsToMs.hour;
|
|
409
|
+
const minutes = Math.floor(left / yummies_ms.unitsToMs.min);
|
|
410
|
+
left = left % yummies_ms.unitsToMs.min;
|
|
411
|
+
const seconds = Math.floor(left / yummies_ms.unitsToMs.sec);
|
|
412
|
+
left = left % yummies_ms.unitsToMs.sec;
|
|
413
|
+
return {
|
|
414
|
+
days,
|
|
415
|
+
hours,
|
|
416
|
+
minutes,
|
|
417
|
+
seconds,
|
|
418
|
+
milliseconds: Math.floor(left)
|
|
419
|
+
};
|
|
318
420
|
};
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
421
|
+
/**
|
|
422
|
+
* Applies one or more date adjustments and returns a new `Date` instance.
|
|
423
|
+
*
|
|
424
|
+
* @example
|
|
425
|
+
* ```ts
|
|
426
|
+
* changeDate(new Date(), 1, 'day', 30, 'minute');
|
|
427
|
+
* ```
|
|
428
|
+
*/
|
|
429
|
+
var changeDate = (date, ...args) => {
|
|
430
|
+
let wrappedDate = toLibFormat(date);
|
|
431
|
+
for (let i = 0; i < args.length; i += 2) {
|
|
432
|
+
const amount = args[i];
|
|
433
|
+
const unit = args[i + 1];
|
|
434
|
+
if (unit != null) wrappedDate = wrappedDate.add(amount, unit);
|
|
435
|
+
}
|
|
436
|
+
return wrappedDate.toDate();
|
|
329
437
|
};
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
438
|
+
/**
|
|
439
|
+
* Converts milliseconds into hour-based time parts without keeping full days separately.
|
|
440
|
+
*
|
|
441
|
+
* @example
|
|
442
|
+
* ```ts
|
|
443
|
+
* timeDuration(ms(1, 'hour') + ms(30, 'min'));
|
|
444
|
+
* ```
|
|
445
|
+
*/
|
|
446
|
+
var timeDuration = (timeInMs) => {
|
|
447
|
+
const { days, hours, milliseconds, minutes, seconds } = dayTimeDuration(timeInMs);
|
|
448
|
+
return {
|
|
449
|
+
hours: hours + yummies_ms.unitsToMs.day * days,
|
|
450
|
+
milliseconds,
|
|
451
|
+
minutes,
|
|
452
|
+
seconds
|
|
453
|
+
};
|
|
338
454
|
};
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
455
|
+
var durationFormatLabels = {
|
|
456
|
+
days: {
|
|
457
|
+
compact: "д",
|
|
458
|
+
full: [
|
|
459
|
+
"день",
|
|
460
|
+
"дня",
|
|
461
|
+
"дней"
|
|
462
|
+
]
|
|
463
|
+
},
|
|
464
|
+
hours: {
|
|
465
|
+
compact: "ч",
|
|
466
|
+
full: [
|
|
467
|
+
"час",
|
|
468
|
+
"часа",
|
|
469
|
+
"часов"
|
|
470
|
+
]
|
|
471
|
+
},
|
|
472
|
+
minutes: {
|
|
473
|
+
compact: "мин",
|
|
474
|
+
full: [
|
|
475
|
+
"минута",
|
|
476
|
+
"минуты",
|
|
477
|
+
"минут"
|
|
478
|
+
]
|
|
479
|
+
},
|
|
480
|
+
seconds: {
|
|
481
|
+
compact: "сек",
|
|
482
|
+
full: [
|
|
483
|
+
"секунда",
|
|
484
|
+
"секунды",
|
|
485
|
+
"секунд"
|
|
486
|
+
]
|
|
487
|
+
}
|
|
344
488
|
};
|
|
345
489
|
function getFormatDuration(...args) {
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
}
|
|
368
|
-
if (hours) {
|
|
369
|
-
if (compact) {
|
|
370
|
-
formattedParts.push(`${hours} ${durationFormatLabels.hours.compact}`);
|
|
371
|
-
} else {
|
|
372
|
-
formattedParts.push(
|
|
373
|
-
`${hours} ${text.declension(hours, durationFormatLabels.hours.full)}`
|
|
374
|
-
);
|
|
375
|
-
}
|
|
376
|
-
}
|
|
377
|
-
if (minutes) {
|
|
378
|
-
if (compact) {
|
|
379
|
-
formattedParts.push(`${minutes} ${durationFormatLabels.minutes.compact}`);
|
|
380
|
-
} else {
|
|
381
|
-
formattedParts.push(
|
|
382
|
-
`${minutes} ${text.declension(minutes, durationFormatLabels.minutes.full)}`
|
|
383
|
-
);
|
|
384
|
-
}
|
|
385
|
-
}
|
|
386
|
-
if (seconds) {
|
|
387
|
-
if (compact) {
|
|
388
|
-
formattedParts.push(`${seconds} ${durationFormatLabels.seconds.compact}`);
|
|
389
|
-
} else {
|
|
390
|
-
formattedParts.push(
|
|
391
|
-
`${seconds} ${text.declension(seconds, durationFormatLabels.seconds.full)}`
|
|
392
|
-
);
|
|
393
|
-
}
|
|
394
|
-
}
|
|
395
|
-
return formattedParts.join(" ");
|
|
490
|
+
let compact = false;
|
|
491
|
+
let diff = 0;
|
|
492
|
+
if (args[0] instanceof Date) {
|
|
493
|
+
const startedDate = (0, dayjs.default)(args[0]);
|
|
494
|
+
diff = (0, dayjs.default)(args[1]).diff(startedDate, "ms");
|
|
495
|
+
compact = args[2] === true;
|
|
496
|
+
} else {
|
|
497
|
+
diff = args[0];
|
|
498
|
+
compact = args[1] === true;
|
|
499
|
+
}
|
|
500
|
+
const { days, hours, minutes, seconds } = dayTimeDuration(diff);
|
|
501
|
+
const formattedParts = [];
|
|
502
|
+
if (days) if (compact) formattedParts.push(`${days} ${durationFormatLabels.days.compact}`);
|
|
503
|
+
else formattedParts.push(`${days} ${(0, yummies_text.declension)(days, durationFormatLabels.days.full)}`);
|
|
504
|
+
if (hours) if (compact) formattedParts.push(`${hours} ${durationFormatLabels.hours.compact}`);
|
|
505
|
+
else formattedParts.push(`${hours} ${(0, yummies_text.declension)(hours, durationFormatLabels.hours.full)}`);
|
|
506
|
+
if (minutes) if (compact) formattedParts.push(`${minutes} ${durationFormatLabels.minutes.compact}`);
|
|
507
|
+
else formattedParts.push(`${minutes} ${(0, yummies_text.declension)(minutes, durationFormatLabels.minutes.full)}`);
|
|
508
|
+
if (seconds) if (compact) formattedParts.push(`${seconds} ${durationFormatLabels.seconds.compact}`);
|
|
509
|
+
else formattedParts.push(`${seconds} ${(0, yummies_text.declension)(seconds, durationFormatLabels.seconds.full)}`);
|
|
510
|
+
return formattedParts.join(" ");
|
|
396
511
|
}
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
512
|
+
/**
|
|
513
|
+
* Calculates the difference between two dates in minutes, seconds and total units.
|
|
514
|
+
*
|
|
515
|
+
* @example
|
|
516
|
+
* ```ts
|
|
517
|
+
* getTimeDiff(new Date('2024-03-15T12:30:00'), new Date('2024-03-15T12:00:00'));
|
|
518
|
+
* ```
|
|
519
|
+
*/
|
|
520
|
+
var getTimeDiff = (dateA, dateB) => {
|
|
521
|
+
const leftDate = toLibFormat(dateA)?.toDate();
|
|
522
|
+
const rightDate = toLibFormat(dateB)?.toDate();
|
|
523
|
+
if (!leftDate || !rightDate) return {
|
|
524
|
+
minutes: 0,
|
|
525
|
+
seconds: 0,
|
|
526
|
+
total: {
|
|
527
|
+
ms: 0,
|
|
528
|
+
hours: 0
|
|
529
|
+
}
|
|
530
|
+
};
|
|
531
|
+
const msDiff = leftDate.getTime() - rightDate.getTime();
|
|
532
|
+
return {
|
|
533
|
+
minutes: Math.max(Math.floor(msDiff / (0, yummies_ms.ms)(1, "min")), 0),
|
|
534
|
+
seconds: Math.max(Math.floor(msDiff % (0, yummies_ms.ms)(1, "min") / 1e3), 0),
|
|
535
|
+
total: {
|
|
536
|
+
hours: Math.round(msDiff / (0, yummies_ms.ms)(1, "hour")),
|
|
537
|
+
ms: msDiff
|
|
538
|
+
}
|
|
539
|
+
};
|
|
416
540
|
};
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
541
|
+
/**
|
|
542
|
+
* Returns a new date shifted forward by the provided number of days.
|
|
543
|
+
*
|
|
544
|
+
* @example
|
|
545
|
+
* ```ts
|
|
546
|
+
* addDays(new Date('2024-03-15'), 7);
|
|
547
|
+
* ```
|
|
548
|
+
*/
|
|
549
|
+
var addDays = (date, count) => toLibFormat(date)?.add(count, "d").toDate();
|
|
550
|
+
/**
|
|
551
|
+
* Returns a new date shifted backward by the provided number of days.
|
|
552
|
+
*
|
|
553
|
+
* @example
|
|
554
|
+
* ```ts
|
|
555
|
+
* subtractDays(new Date('2024-03-15'), 7);
|
|
556
|
+
* ```
|
|
557
|
+
*/
|
|
558
|
+
var subtractDays = (date, count) => toLibFormat(date)?.subtract(count, "d").toDate();
|
|
559
|
+
/**
|
|
560
|
+
* Returns a new date shifted forward by the provided number of minutes.
|
|
561
|
+
*
|
|
562
|
+
* @example
|
|
563
|
+
* ```ts
|
|
564
|
+
* addMinutes(new Date('2024-03-15T12:00:00'), 15);
|
|
565
|
+
* ```
|
|
566
|
+
*/
|
|
567
|
+
var addMinutes = (date, count) => toLibFormat(date)?.add(count, "m").toDate();
|
|
568
|
+
/**
|
|
569
|
+
* Returns a new date with the minutes field replaced.
|
|
570
|
+
*
|
|
571
|
+
* @example
|
|
572
|
+
* ```ts
|
|
573
|
+
* setMinutes(new Date('2024-03-15T12:00:00'), 45);
|
|
574
|
+
* ```
|
|
575
|
+
*/
|
|
576
|
+
var setMinutes = (date, minutes) => toLibFormat(date)?.set("m", minutes).toDate();
|
|
577
|
+
/**
|
|
578
|
+
* Returns a new date with the hours field replaced.
|
|
579
|
+
*
|
|
580
|
+
* @example
|
|
581
|
+
* ```ts
|
|
582
|
+
* setHours(new Date('2024-03-15T12:00:00'), 9);
|
|
583
|
+
* ```
|
|
584
|
+
*/
|
|
585
|
+
var setHours = (date, hours) => toLibFormat(date)?.set("h", hours).toDate();
|
|
586
|
+
//#endregion
|
|
422
587
|
exports.addDays = addDays;
|
|
423
588
|
exports.addMinutes = addMinutes;
|
|
424
589
|
exports.changeDate = changeDate;
|
|
@@ -430,4 +595,5 @@ exports.setHours = setHours;
|
|
|
430
595
|
exports.setMinutes = setMinutes;
|
|
431
596
|
exports.subtractDays = subtractDays;
|
|
432
597
|
exports.timeDuration = timeDuration;
|
|
433
|
-
|
|
598
|
+
|
|
599
|
+
//# sourceMappingURL=date-time.cjs.map
|