@neutron.co.id/operasional-interfaces 1.3.0-beta.1 → 1.3.0-beta.2
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/build/index.cjs +81 -1097
- package/build/index.mjs +81 -1097
- package/build/style.css +11 -11
- package/package.json +2 -2
- package/build/types/utils/date/index.d.ts +0 -11
- package/build/types/utils/date/util.date.d.ts +0 -20
- package/build/types/utils/index.d.ts +0 -1
package/build/index.mjs
CHANGED
|
@@ -3,15 +3,14 @@ import { defineComponent, openBlock, createElementBlock, createVNode, unref, onB
|
|
|
3
3
|
import { NeonButton, useToastStore, NeonSlider, NeonSlide, NeonStat, NeonModal, NeonSheet, NeonInfo } from "@neon.id/interfaces";
|
|
4
4
|
import { models } from "@neutron.co.id/tempat-models";
|
|
5
5
|
import { GraphUtil, NeonCollectionContext, useSingle, NeonSingle, useCollection, NeonCollection } from "@neon.id/context";
|
|
6
|
+
import { useEventBus, useIntervalFn, useThrottleFn } from "@vueuse/core";
|
|
6
7
|
import { OfficeContent, OfficeCollectionQuery, OfficeCollectionOperation, OfficeTabs, OfficeTab, OfficeRelation, OfficeCollectionTable } from "@neon.id/office";
|
|
7
8
|
import { Query } from "@neon.id/query";
|
|
8
|
-
import { CheckInCollection } from "@neutron.co.id/sentral-interfaces";
|
|
9
|
-
import { useAuthStore } from "@neon.id/identitas-interfaces";
|
|
10
9
|
import { defineStore, storeToRefs } from "pinia";
|
|
11
10
|
import { ComponentUtil } from "@neon.id/utils/component";
|
|
12
|
-
import { useIntervalFn, useThrottleFn } from "@vueuse/core";
|
|
13
11
|
import { NeonForm, NeonField, NeonFields } from "@neon.id/form";
|
|
14
12
|
import { models as models$1 } from "@neutron.co.id/personalia-models";
|
|
13
|
+
import { useAuthStore } from "@neon.id/identitas-interfaces";
|
|
15
14
|
const _hoisted_1$8 = { class: "xxx-button" };
|
|
16
15
|
const __default__$8 = defineComponent({ name: "XxxButton" });
|
|
17
16
|
const _sfc_main$j = /* @__PURE__ */ defineComponent({
|
|
@@ -3545,250 +3544,7 @@ function useClientHandle() {
|
|
|
3545
3544
|
}
|
|
3546
3545
|
return r2;
|
|
3547
3546
|
}
|
|
3548
|
-
|
|
3549
|
-
function getDefaultExportFromCjs(x) {
|
|
3550
|
-
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
|
|
3551
|
-
}
|
|
3552
|
-
var dayjs_minExports = {};
|
|
3553
|
-
var dayjs_min = {
|
|
3554
|
-
get exports() {
|
|
3555
|
-
return dayjs_minExports;
|
|
3556
|
-
},
|
|
3557
|
-
set exports(v2) {
|
|
3558
|
-
dayjs_minExports = v2;
|
|
3559
|
-
}
|
|
3560
|
-
};
|
|
3561
|
-
(function(module, exports) {
|
|
3562
|
-
!function(t2, e2) {
|
|
3563
|
-
module.exports = e2();
|
|
3564
|
-
}(commonjsGlobal, function() {
|
|
3565
|
-
var t2 = 1e3, e2 = 6e4, n = 36e5, r2 = "millisecond", i2 = "second", s2 = "minute", u = "hour", a = "day", o2 = "week", f2 = "month", h = "quarter", c = "year", d2 = "date", l2 = "Invalid Date", $ = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, y = /\[([^\]]+)]|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, M = { name: "en", weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), ordinal: function(t3) {
|
|
3566
|
-
var e3 = ["th", "st", "nd", "rd"], n2 = t3 % 100;
|
|
3567
|
-
return "[" + t3 + (e3[(n2 - 20) % 10] || e3[n2] || e3[0]) + "]";
|
|
3568
|
-
} }, m = function(t3, e3, n2) {
|
|
3569
|
-
var r3 = String(t3);
|
|
3570
|
-
return !r3 || r3.length >= e3 ? t3 : "" + Array(e3 + 1 - r3.length).join(n2) + t3;
|
|
3571
|
-
}, v2 = { s: m, z: function(t3) {
|
|
3572
|
-
var e3 = -t3.utcOffset(), n2 = Math.abs(e3), r3 = Math.floor(n2 / 60), i3 = n2 % 60;
|
|
3573
|
-
return (e3 <= 0 ? "+" : "-") + m(r3, 2, "0") + ":" + m(i3, 2, "0");
|
|
3574
|
-
}, m: function t3(e3, n2) {
|
|
3575
|
-
if (e3.date() < n2.date())
|
|
3576
|
-
return -t3(n2, e3);
|
|
3577
|
-
var r3 = 12 * (n2.year() - e3.year()) + (n2.month() - e3.month()), i3 = e3.clone().add(r3, f2), s3 = n2 - i3 < 0, u2 = e3.clone().add(r3 + (s3 ? -1 : 1), f2);
|
|
3578
|
-
return +(-(r3 + (n2 - i3) / (s3 ? i3 - u2 : u2 - i3)) || 0);
|
|
3579
|
-
}, a: function(t3) {
|
|
3580
|
-
return t3 < 0 ? Math.ceil(t3) || 0 : Math.floor(t3);
|
|
3581
|
-
}, p: function(t3) {
|
|
3582
|
-
return { M: f2, y: c, w: o2, d: a, D: d2, h: u, m: s2, s: i2, ms: r2, Q: h }[t3] || String(t3 || "").toLowerCase().replace(/s$/, "");
|
|
3583
|
-
}, u: function(t3) {
|
|
3584
|
-
return void 0 === t3;
|
|
3585
|
-
} }, g = "en", D = {};
|
|
3586
|
-
D[g] = M;
|
|
3587
|
-
var p = function(t3) {
|
|
3588
|
-
return t3 instanceof _;
|
|
3589
|
-
}, S = function t3(e3, n2, r3) {
|
|
3590
|
-
var i3;
|
|
3591
|
-
if (!e3)
|
|
3592
|
-
return g;
|
|
3593
|
-
if ("string" == typeof e3) {
|
|
3594
|
-
var s3 = e3.toLowerCase();
|
|
3595
|
-
D[s3] && (i3 = s3), n2 && (D[s3] = n2, i3 = s3);
|
|
3596
|
-
var u2 = e3.split("-");
|
|
3597
|
-
if (!i3 && u2.length > 1)
|
|
3598
|
-
return t3(u2[0]);
|
|
3599
|
-
} else {
|
|
3600
|
-
var a2 = e3.name;
|
|
3601
|
-
D[a2] = e3, i3 = a2;
|
|
3602
|
-
}
|
|
3603
|
-
return !r3 && i3 && (g = i3), i3 || !r3 && g;
|
|
3604
|
-
}, w = function(t3, e3) {
|
|
3605
|
-
if (p(t3))
|
|
3606
|
-
return t3.clone();
|
|
3607
|
-
var n2 = "object" == typeof e3 ? e3 : {};
|
|
3608
|
-
return n2.date = t3, n2.args = arguments, new _(n2);
|
|
3609
|
-
}, O = v2;
|
|
3610
|
-
O.l = S, O.i = p, O.w = function(t3, e3) {
|
|
3611
|
-
return w(t3, { locale: e3.$L, utc: e3.$u, x: e3.$x, $offset: e3.$offset });
|
|
3612
|
-
};
|
|
3613
|
-
var _ = function() {
|
|
3614
|
-
function M2(t3) {
|
|
3615
|
-
this.$L = S(t3.locale, null, true), this.parse(t3);
|
|
3616
|
-
}
|
|
3617
|
-
var m2 = M2.prototype;
|
|
3618
|
-
return m2.parse = function(t3) {
|
|
3619
|
-
this.$d = function(t4) {
|
|
3620
|
-
var e3 = t4.date, n2 = t4.utc;
|
|
3621
|
-
if (null === e3)
|
|
3622
|
-
return new Date(NaN);
|
|
3623
|
-
if (O.u(e3))
|
|
3624
|
-
return new Date();
|
|
3625
|
-
if (e3 instanceof Date)
|
|
3626
|
-
return new Date(e3);
|
|
3627
|
-
if ("string" == typeof e3 && !/Z$/i.test(e3)) {
|
|
3628
|
-
var r3 = e3.match($);
|
|
3629
|
-
if (r3) {
|
|
3630
|
-
var i3 = r3[2] - 1 || 0, s3 = (r3[7] || "0").substring(0, 3);
|
|
3631
|
-
return n2 ? new Date(Date.UTC(r3[1], i3, r3[3] || 1, r3[4] || 0, r3[5] || 0, r3[6] || 0, s3)) : new Date(r3[1], i3, r3[3] || 1, r3[4] || 0, r3[5] || 0, r3[6] || 0, s3);
|
|
3632
|
-
}
|
|
3633
|
-
}
|
|
3634
|
-
return new Date(e3);
|
|
3635
|
-
}(t3), this.$x = t3.x || {}, this.init();
|
|
3636
|
-
}, m2.init = function() {
|
|
3637
|
-
var t3 = this.$d;
|
|
3638
|
-
this.$y = t3.getFullYear(), this.$M = t3.getMonth(), this.$D = t3.getDate(), this.$W = t3.getDay(), this.$H = t3.getHours(), this.$m = t3.getMinutes(), this.$s = t3.getSeconds(), this.$ms = t3.getMilliseconds();
|
|
3639
|
-
}, m2.$utils = function() {
|
|
3640
|
-
return O;
|
|
3641
|
-
}, m2.isValid = function() {
|
|
3642
|
-
return !(this.$d.toString() === l2);
|
|
3643
|
-
}, m2.isSame = function(t3, e3) {
|
|
3644
|
-
var n2 = w(t3);
|
|
3645
|
-
return this.startOf(e3) <= n2 && n2 <= this.endOf(e3);
|
|
3646
|
-
}, m2.isAfter = function(t3, e3) {
|
|
3647
|
-
return w(t3) < this.startOf(e3);
|
|
3648
|
-
}, m2.isBefore = function(t3, e3) {
|
|
3649
|
-
return this.endOf(e3) < w(t3);
|
|
3650
|
-
}, m2.$g = function(t3, e3, n2) {
|
|
3651
|
-
return O.u(t3) ? this[e3] : this.set(n2, t3);
|
|
3652
|
-
}, m2.unix = function() {
|
|
3653
|
-
return Math.floor(this.valueOf() / 1e3);
|
|
3654
|
-
}, m2.valueOf = function() {
|
|
3655
|
-
return this.$d.getTime();
|
|
3656
|
-
}, m2.startOf = function(t3, e3) {
|
|
3657
|
-
var n2 = this, r3 = !!O.u(e3) || e3, h2 = O.p(t3), l3 = function(t4, e4) {
|
|
3658
|
-
var i3 = O.w(n2.$u ? Date.UTC(n2.$y, e4, t4) : new Date(n2.$y, e4, t4), n2);
|
|
3659
|
-
return r3 ? i3 : i3.endOf(a);
|
|
3660
|
-
}, $2 = function(t4, e4) {
|
|
3661
|
-
return O.w(n2.toDate()[t4].apply(n2.toDate("s"), (r3 ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(e4)), n2);
|
|
3662
|
-
}, y2 = this.$W, M3 = this.$M, m3 = this.$D, v3 = "set" + (this.$u ? "UTC" : "");
|
|
3663
|
-
switch (h2) {
|
|
3664
|
-
case c:
|
|
3665
|
-
return r3 ? l3(1, 0) : l3(31, 11);
|
|
3666
|
-
case f2:
|
|
3667
|
-
return r3 ? l3(1, M3) : l3(0, M3 + 1);
|
|
3668
|
-
case o2:
|
|
3669
|
-
var g2 = this.$locale().weekStart || 0, D2 = (y2 < g2 ? y2 + 7 : y2) - g2;
|
|
3670
|
-
return l3(r3 ? m3 - D2 : m3 + (6 - D2), M3);
|
|
3671
|
-
case a:
|
|
3672
|
-
case d2:
|
|
3673
|
-
return $2(v3 + "Hours", 0);
|
|
3674
|
-
case u:
|
|
3675
|
-
return $2(v3 + "Minutes", 1);
|
|
3676
|
-
case s2:
|
|
3677
|
-
return $2(v3 + "Seconds", 2);
|
|
3678
|
-
case i2:
|
|
3679
|
-
return $2(v3 + "Milliseconds", 3);
|
|
3680
|
-
default:
|
|
3681
|
-
return this.clone();
|
|
3682
|
-
}
|
|
3683
|
-
}, m2.endOf = function(t3) {
|
|
3684
|
-
return this.startOf(t3, false);
|
|
3685
|
-
}, m2.$set = function(t3, e3) {
|
|
3686
|
-
var n2, o3 = O.p(t3), h2 = "set" + (this.$u ? "UTC" : ""), l3 = (n2 = {}, n2[a] = h2 + "Date", n2[d2] = h2 + "Date", n2[f2] = h2 + "Month", n2[c] = h2 + "FullYear", n2[u] = h2 + "Hours", n2[s2] = h2 + "Minutes", n2[i2] = h2 + "Seconds", n2[r2] = h2 + "Milliseconds", n2)[o3], $2 = o3 === a ? this.$D + (e3 - this.$W) : e3;
|
|
3687
|
-
if (o3 === f2 || o3 === c) {
|
|
3688
|
-
var y2 = this.clone().set(d2, 1);
|
|
3689
|
-
y2.$d[l3]($2), y2.init(), this.$d = y2.set(d2, Math.min(this.$D, y2.daysInMonth())).$d;
|
|
3690
|
-
} else
|
|
3691
|
-
l3 && this.$d[l3]($2);
|
|
3692
|
-
return this.init(), this;
|
|
3693
|
-
}, m2.set = function(t3, e3) {
|
|
3694
|
-
return this.clone().$set(t3, e3);
|
|
3695
|
-
}, m2.get = function(t3) {
|
|
3696
|
-
return this[O.p(t3)]();
|
|
3697
|
-
}, m2.add = function(r3, h2) {
|
|
3698
|
-
var d3, l3 = this;
|
|
3699
|
-
r3 = Number(r3);
|
|
3700
|
-
var $2 = O.p(h2), y2 = function(t3) {
|
|
3701
|
-
var e3 = w(l3);
|
|
3702
|
-
return O.w(e3.date(e3.date() + Math.round(t3 * r3)), l3);
|
|
3703
|
-
};
|
|
3704
|
-
if ($2 === f2)
|
|
3705
|
-
return this.set(f2, this.$M + r3);
|
|
3706
|
-
if ($2 === c)
|
|
3707
|
-
return this.set(c, this.$y + r3);
|
|
3708
|
-
if ($2 === a)
|
|
3709
|
-
return y2(1);
|
|
3710
|
-
if ($2 === o2)
|
|
3711
|
-
return y2(7);
|
|
3712
|
-
var M3 = (d3 = {}, d3[s2] = e2, d3[u] = n, d3[i2] = t2, d3)[$2] || 1, m3 = this.$d.getTime() + r3 * M3;
|
|
3713
|
-
return O.w(m3, this);
|
|
3714
|
-
}, m2.subtract = function(t3, e3) {
|
|
3715
|
-
return this.add(-1 * t3, e3);
|
|
3716
|
-
}, m2.format = function(t3) {
|
|
3717
|
-
var e3 = this, n2 = this.$locale();
|
|
3718
|
-
if (!this.isValid())
|
|
3719
|
-
return n2.invalidDate || l2;
|
|
3720
|
-
var r3 = t3 || "YYYY-MM-DDTHH:mm:ssZ", i3 = O.z(this), s3 = this.$H, u2 = this.$m, a2 = this.$M, o3 = n2.weekdays, f3 = n2.months, h2 = function(t4, n3, i4, s4) {
|
|
3721
|
-
return t4 && (t4[n3] || t4(e3, r3)) || i4[n3].slice(0, s4);
|
|
3722
|
-
}, c2 = function(t4) {
|
|
3723
|
-
return O.s(s3 % 12 || 12, t4, "0");
|
|
3724
|
-
}, d3 = n2.meridiem || function(t4, e4, n3) {
|
|
3725
|
-
var r4 = t4 < 12 ? "AM" : "PM";
|
|
3726
|
-
return n3 ? r4.toLowerCase() : r4;
|
|
3727
|
-
}, $2 = { YY: String(this.$y).slice(-2), YYYY: this.$y, M: a2 + 1, MM: O.s(a2 + 1, 2, "0"), MMM: h2(n2.monthsShort, a2, f3, 3), MMMM: h2(f3, a2), D: this.$D, DD: O.s(this.$D, 2, "0"), d: String(this.$W), dd: h2(n2.weekdaysMin, this.$W, o3, 2), ddd: h2(n2.weekdaysShort, this.$W, o3, 3), dddd: o3[this.$W], H: String(s3), HH: O.s(s3, 2, "0"), h: c2(1), hh: c2(2), a: d3(s3, u2, true), A: d3(s3, u2, false), m: String(u2), mm: O.s(u2, 2, "0"), s: String(this.$s), ss: O.s(this.$s, 2, "0"), SSS: O.s(this.$ms, 3, "0"), Z: i3 };
|
|
3728
|
-
return r3.replace(y, function(t4, e4) {
|
|
3729
|
-
return e4 || $2[t4] || i3.replace(":", "");
|
|
3730
|
-
});
|
|
3731
|
-
}, m2.utcOffset = function() {
|
|
3732
|
-
return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
|
|
3733
|
-
}, m2.diff = function(r3, d3, l3) {
|
|
3734
|
-
var $2, y2 = O.p(d3), M3 = w(r3), m3 = (M3.utcOffset() - this.utcOffset()) * e2, v3 = this - M3, g2 = O.m(this, M3);
|
|
3735
|
-
return g2 = ($2 = {}, $2[c] = g2 / 12, $2[f2] = g2, $2[h] = g2 / 3, $2[o2] = (v3 - m3) / 6048e5, $2[a] = (v3 - m3) / 864e5, $2[u] = v3 / n, $2[s2] = v3 / e2, $2[i2] = v3 / t2, $2)[y2] || v3, l3 ? g2 : O.a(g2);
|
|
3736
|
-
}, m2.daysInMonth = function() {
|
|
3737
|
-
return this.endOf(f2).$D;
|
|
3738
|
-
}, m2.$locale = function() {
|
|
3739
|
-
return D[this.$L];
|
|
3740
|
-
}, m2.locale = function(t3, e3) {
|
|
3741
|
-
if (!t3)
|
|
3742
|
-
return this.$L;
|
|
3743
|
-
var n2 = this.clone(), r3 = S(t3, e3, true);
|
|
3744
|
-
return r3 && (n2.$L = r3), n2;
|
|
3745
|
-
}, m2.clone = function() {
|
|
3746
|
-
return O.w(this.$d, this);
|
|
3747
|
-
}, m2.toDate = function() {
|
|
3748
|
-
return new Date(this.valueOf());
|
|
3749
|
-
}, m2.toJSON = function() {
|
|
3750
|
-
return this.isValid() ? this.toISOString() : null;
|
|
3751
|
-
}, m2.toISOString = function() {
|
|
3752
|
-
return this.$d.toISOString();
|
|
3753
|
-
}, m2.toString = function() {
|
|
3754
|
-
return this.$d.toUTCString();
|
|
3755
|
-
}, M2;
|
|
3756
|
-
}(), T = _.prototype;
|
|
3757
|
-
return w.prototype = T, [["$ms", r2], ["$s", i2], ["$m", s2], ["$H", u], ["$W", a], ["$M", f2], ["$y", c], ["$D", d2]].forEach(function(t3) {
|
|
3758
|
-
T[t3[1]] = function(e3) {
|
|
3759
|
-
return this.$g(e3, t3[0], t3[1]);
|
|
3760
|
-
};
|
|
3761
|
-
}), w.extend = function(t3, e3) {
|
|
3762
|
-
return t3.$i || (t3(e3, _, w), t3.$i = true), w;
|
|
3763
|
-
}, w.locale = S, w.isDayjs = p, w.unix = function(t3) {
|
|
3764
|
-
return w(1e3 * t3);
|
|
3765
|
-
}, w.en = D[g], w.Ls = D, w.p = {}, w;
|
|
3766
|
-
});
|
|
3767
|
-
})(dayjs_min);
|
|
3768
|
-
const dayjs = dayjs_minExports;
|
|
3769
|
-
var idExports = {};
|
|
3770
|
-
var id = {
|
|
3771
|
-
get exports() {
|
|
3772
|
-
return idExports;
|
|
3773
|
-
},
|
|
3774
|
-
set exports(v2) {
|
|
3775
|
-
idExports = v2;
|
|
3776
|
-
}
|
|
3777
|
-
};
|
|
3778
|
-
(function(module, exports) {
|
|
3779
|
-
!function(e2, a) {
|
|
3780
|
-
module.exports = a(dayjs_minExports);
|
|
3781
|
-
}(commonjsGlobal, function(e2) {
|
|
3782
|
-
function a(e3) {
|
|
3783
|
-
return e3 && "object" == typeof e3 && "default" in e3 ? e3 : { default: e3 };
|
|
3784
|
-
}
|
|
3785
|
-
var t2 = a(e2), _ = { name: "id", weekdays: "Minggu_Senin_Selasa_Rabu_Kamis_Jumat_Sabtu".split("_"), months: "Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_November_Desember".split("_"), weekdaysShort: "Min_Sen_Sel_Rab_Kam_Jum_Sab".split("_"), monthsShort: "Jan_Feb_Mar_Apr_Mei_Jun_Jul_Agt_Sep_Okt_Nov_Des".split("_"), weekdaysMin: "Mg_Sn_Sl_Rb_Km_Jm_Sb".split("_"), weekStart: 1, formats: { LT: "HH.mm", LTS: "HH.mm.ss", L: "DD/MM/YYYY", LL: "D MMMM YYYY", LLL: "D MMMM YYYY [pukul] HH.mm", LLLL: "dddd, D MMMM YYYY [pukul] HH.mm" }, relativeTime: { future: "dalam %s", past: "%s yang lalu", s: "beberapa detik", m: "semenit", mm: "%d menit", h: "sejam", hh: "%d jam", d: "sehari", dd: "%d hari", M: "sebulan", MM: "%d bulan", y: "setahun", yy: "%d tahun" }, ordinal: function(e3) {
|
|
3786
|
-
return e3 + ".";
|
|
3787
|
-
} };
|
|
3788
|
-
return t2.default.locale(_, null, true), _;
|
|
3789
|
-
});
|
|
3790
|
-
})(id);
|
|
3791
|
-
function toInteger$2(dirtyNumber) {
|
|
3547
|
+
function toInteger(dirtyNumber) {
|
|
3792
3548
|
if (dirtyNumber === null || dirtyNumber === true || dirtyNumber === false) {
|
|
3793
3549
|
return NaN;
|
|
3794
3550
|
}
|
|
@@ -3816,7 +3572,7 @@ function _typeof(obj) {
|
|
|
3816
3572
|
}
|
|
3817
3573
|
return _typeof(obj);
|
|
3818
3574
|
}
|
|
3819
|
-
function toDate
|
|
3575
|
+
function toDate(argument) {
|
|
3820
3576
|
requiredArgs(1, arguments);
|
|
3821
3577
|
var argStr = Object.prototype.toString.call(argument);
|
|
3822
3578
|
if (argument instanceof Date || _typeof(argument) === "object" && argStr === "[object Date]") {
|
|
@@ -3831,843 +3587,36 @@ function toDate$1(argument) {
|
|
|
3831
3587
|
return new Date(NaN);
|
|
3832
3588
|
}
|
|
3833
3589
|
}
|
|
3590
|
+
function addDays(dirtyDate, dirtyAmount) {
|
|
3591
|
+
requiredArgs(2, arguments);
|
|
3592
|
+
var date = toDate(dirtyDate);
|
|
3593
|
+
var amount = toInteger(dirtyAmount);
|
|
3594
|
+
if (isNaN(amount)) {
|
|
3595
|
+
return new Date(NaN);
|
|
3596
|
+
}
|
|
3597
|
+
if (!amount) {
|
|
3598
|
+
return date;
|
|
3599
|
+
}
|
|
3600
|
+
date.setDate(date.getDate() + amount);
|
|
3601
|
+
return date;
|
|
3602
|
+
}
|
|
3834
3603
|
function startOfDay(dirtyDate) {
|
|
3835
3604
|
requiredArgs(1, arguments);
|
|
3836
|
-
var date = toDate
|
|
3605
|
+
var date = toDate(dirtyDate);
|
|
3837
3606
|
date.setHours(0, 0, 0, 0);
|
|
3838
3607
|
return date;
|
|
3839
3608
|
}
|
|
3840
|
-
var millisecondsInMinute = 6e4;
|
|
3841
|
-
var millisecondsInHour = 36e5;
|
|
3842
3609
|
function endOfDay(dirtyDate) {
|
|
3843
3610
|
requiredArgs(1, arguments);
|
|
3844
|
-
var date = toDate
|
|
3611
|
+
var date = toDate(dirtyDate);
|
|
3845
3612
|
date.setHours(23, 59, 59, 999);
|
|
3846
3613
|
return date;
|
|
3847
3614
|
}
|
|
3848
|
-
function
|
|
3849
|
-
|
|
3850
|
-
requiredArgs(1, arguments);
|
|
3851
|
-
var additionalDigits = toInteger$2((_options$additionalDi = options === null || options === void 0 ? void 0 : options.additionalDigits) !== null && _options$additionalDi !== void 0 ? _options$additionalDi : 2);
|
|
3852
|
-
if (additionalDigits !== 2 && additionalDigits !== 1 && additionalDigits !== 0) {
|
|
3853
|
-
throw new RangeError("additionalDigits must be 0, 1 or 2");
|
|
3854
|
-
}
|
|
3855
|
-
if (!(typeof argument === "string" || Object.prototype.toString.call(argument) === "[object String]")) {
|
|
3856
|
-
return new Date(NaN);
|
|
3857
|
-
}
|
|
3858
|
-
var dateStrings = splitDateString$1(argument);
|
|
3859
|
-
var date;
|
|
3860
|
-
if (dateStrings.date) {
|
|
3861
|
-
var parseYearResult = parseYear$1(dateStrings.date, additionalDigits);
|
|
3862
|
-
date = parseDate$1(parseYearResult.restDateString, parseYearResult.year);
|
|
3863
|
-
}
|
|
3864
|
-
if (!date || isNaN(date.getTime())) {
|
|
3865
|
-
return new Date(NaN);
|
|
3866
|
-
}
|
|
3867
|
-
var timestamp = date.getTime();
|
|
3868
|
-
var time = 0;
|
|
3869
|
-
var offset;
|
|
3870
|
-
if (dateStrings.time) {
|
|
3871
|
-
time = parseTime$1(dateStrings.time);
|
|
3872
|
-
if (isNaN(time)) {
|
|
3873
|
-
return new Date(NaN);
|
|
3874
|
-
}
|
|
3875
|
-
}
|
|
3876
|
-
if (dateStrings.timezone) {
|
|
3877
|
-
offset = parseTimezone(dateStrings.timezone);
|
|
3878
|
-
if (isNaN(offset)) {
|
|
3879
|
-
return new Date(NaN);
|
|
3880
|
-
}
|
|
3881
|
-
} else {
|
|
3882
|
-
var dirtyDate = new Date(timestamp + time);
|
|
3883
|
-
var result = new Date(0);
|
|
3884
|
-
result.setFullYear(dirtyDate.getUTCFullYear(), dirtyDate.getUTCMonth(), dirtyDate.getUTCDate());
|
|
3885
|
-
result.setHours(dirtyDate.getUTCHours(), dirtyDate.getUTCMinutes(), dirtyDate.getUTCSeconds(), dirtyDate.getUTCMilliseconds());
|
|
3886
|
-
return result;
|
|
3887
|
-
}
|
|
3888
|
-
return new Date(timestamp + time + offset);
|
|
3889
|
-
}
|
|
3890
|
-
var patterns$2 = {
|
|
3891
|
-
dateTimeDelimiter: /[T ]/,
|
|
3892
|
-
timeZoneDelimiter: /[Z ]/i,
|
|
3893
|
-
timezone: /([Z+-].*)$/
|
|
3894
|
-
};
|
|
3895
|
-
var dateRegex = /^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/;
|
|
3896
|
-
var timeRegex = /^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/;
|
|
3897
|
-
var timezoneRegex = /^([+-])(\d{2})(?::?(\d{2}))?$/;
|
|
3898
|
-
function splitDateString$1(dateString) {
|
|
3899
|
-
var dateStrings = {};
|
|
3900
|
-
var array = dateString.split(patterns$2.dateTimeDelimiter);
|
|
3901
|
-
var timeString;
|
|
3902
|
-
if (array.length > 2) {
|
|
3903
|
-
return dateStrings;
|
|
3904
|
-
}
|
|
3905
|
-
if (/:/.test(array[0])) {
|
|
3906
|
-
timeString = array[0];
|
|
3907
|
-
} else {
|
|
3908
|
-
dateStrings.date = array[0];
|
|
3909
|
-
timeString = array[1];
|
|
3910
|
-
if (patterns$2.timeZoneDelimiter.test(dateStrings.date)) {
|
|
3911
|
-
dateStrings.date = dateString.split(patterns$2.timeZoneDelimiter)[0];
|
|
3912
|
-
timeString = dateString.substr(dateStrings.date.length, dateString.length);
|
|
3913
|
-
}
|
|
3914
|
-
}
|
|
3915
|
-
if (timeString) {
|
|
3916
|
-
var token = patterns$2.timezone.exec(timeString);
|
|
3917
|
-
if (token) {
|
|
3918
|
-
dateStrings.time = timeString.replace(token[1], "");
|
|
3919
|
-
dateStrings.timezone = token[1];
|
|
3920
|
-
} else {
|
|
3921
|
-
dateStrings.time = timeString;
|
|
3922
|
-
}
|
|
3923
|
-
}
|
|
3924
|
-
return dateStrings;
|
|
3925
|
-
}
|
|
3926
|
-
function parseYear$1(dateString, additionalDigits) {
|
|
3927
|
-
var regex = new RegExp("^(?:(\\d{4}|[+-]\\d{" + (4 + additionalDigits) + "})|(\\d{2}|[+-]\\d{" + (2 + additionalDigits) + "})$)");
|
|
3928
|
-
var captures = dateString.match(regex);
|
|
3929
|
-
if (!captures)
|
|
3930
|
-
return {
|
|
3931
|
-
year: NaN,
|
|
3932
|
-
restDateString: ""
|
|
3933
|
-
};
|
|
3934
|
-
var year = captures[1] ? parseInt(captures[1]) : null;
|
|
3935
|
-
var century = captures[2] ? parseInt(captures[2]) : null;
|
|
3936
|
-
return {
|
|
3937
|
-
year: century === null ? year : century * 100,
|
|
3938
|
-
restDateString: dateString.slice((captures[1] || captures[2]).length)
|
|
3939
|
-
};
|
|
3940
|
-
}
|
|
3941
|
-
function parseDate$1(dateString, year) {
|
|
3942
|
-
if (year === null)
|
|
3943
|
-
return new Date(NaN);
|
|
3944
|
-
var captures = dateString.match(dateRegex);
|
|
3945
|
-
if (!captures)
|
|
3946
|
-
return new Date(NaN);
|
|
3947
|
-
var isWeekDate = !!captures[4];
|
|
3948
|
-
var dayOfYear = parseDateUnit(captures[1]);
|
|
3949
|
-
var month = parseDateUnit(captures[2]) - 1;
|
|
3950
|
-
var day = parseDateUnit(captures[3]);
|
|
3951
|
-
var week = parseDateUnit(captures[4]);
|
|
3952
|
-
var dayOfWeek = parseDateUnit(captures[5]) - 1;
|
|
3953
|
-
if (isWeekDate) {
|
|
3954
|
-
if (!validateWeekDate$1(year, week, dayOfWeek)) {
|
|
3955
|
-
return new Date(NaN);
|
|
3956
|
-
}
|
|
3957
|
-
return dayOfISOWeekYear$1(year, week, dayOfWeek);
|
|
3958
|
-
} else {
|
|
3959
|
-
var date = new Date(0);
|
|
3960
|
-
if (!validateDate$1(year, month, day) || !validateDayOfYearDate$1(year, dayOfYear)) {
|
|
3961
|
-
return new Date(NaN);
|
|
3962
|
-
}
|
|
3963
|
-
date.setUTCFullYear(year, month, Math.max(dayOfYear, day));
|
|
3964
|
-
return date;
|
|
3965
|
-
}
|
|
3966
|
-
}
|
|
3967
|
-
function parseDateUnit(value) {
|
|
3968
|
-
return value ? parseInt(value) : 1;
|
|
3969
|
-
}
|
|
3970
|
-
function parseTime$1(timeString) {
|
|
3971
|
-
var captures = timeString.match(timeRegex);
|
|
3972
|
-
if (!captures)
|
|
3973
|
-
return NaN;
|
|
3974
|
-
var hours = parseTimeUnit(captures[1]);
|
|
3975
|
-
var minutes = parseTimeUnit(captures[2]);
|
|
3976
|
-
var seconds = parseTimeUnit(captures[3]);
|
|
3977
|
-
if (!validateTime$1(hours, minutes, seconds)) {
|
|
3978
|
-
return NaN;
|
|
3979
|
-
}
|
|
3980
|
-
return hours * millisecondsInHour + minutes * millisecondsInMinute + seconds * 1e3;
|
|
3981
|
-
}
|
|
3982
|
-
function parseTimeUnit(value) {
|
|
3983
|
-
return value && parseFloat(value.replace(",", ".")) || 0;
|
|
3984
|
-
}
|
|
3985
|
-
function parseTimezone(timezoneString) {
|
|
3986
|
-
if (timezoneString === "Z")
|
|
3987
|
-
return 0;
|
|
3988
|
-
var captures = timezoneString.match(timezoneRegex);
|
|
3989
|
-
if (!captures)
|
|
3990
|
-
return 0;
|
|
3991
|
-
var sign = captures[1] === "+" ? -1 : 1;
|
|
3992
|
-
var hours = parseInt(captures[2]);
|
|
3993
|
-
var minutes = captures[3] && parseInt(captures[3]) || 0;
|
|
3994
|
-
if (!validateTimezone$1(hours, minutes)) {
|
|
3995
|
-
return NaN;
|
|
3996
|
-
}
|
|
3997
|
-
return sign * (hours * millisecondsInHour + minutes * millisecondsInMinute);
|
|
3998
|
-
}
|
|
3999
|
-
function dayOfISOWeekYear$1(isoWeekYear, week, day) {
|
|
4000
|
-
var date = new Date(0);
|
|
4001
|
-
date.setUTCFullYear(isoWeekYear, 0, 4);
|
|
4002
|
-
var fourthOfJanuaryDay = date.getUTCDay() || 7;
|
|
4003
|
-
var diff = (week - 1) * 7 + day + 1 - fourthOfJanuaryDay;
|
|
4004
|
-
date.setUTCDate(date.getUTCDate() + diff);
|
|
4005
|
-
return date;
|
|
4006
|
-
}
|
|
4007
|
-
var daysInMonths = [31, null, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
|
|
4008
|
-
function isLeapYearIndex$1(year) {
|
|
4009
|
-
return year % 400 === 0 || year % 4 === 0 && year % 100 !== 0;
|
|
4010
|
-
}
|
|
4011
|
-
function validateDate$1(year, month, date) {
|
|
4012
|
-
return month >= 0 && month <= 11 && date >= 1 && date <= (daysInMonths[month] || (isLeapYearIndex$1(year) ? 29 : 28));
|
|
4013
|
-
}
|
|
4014
|
-
function validateDayOfYearDate$1(year, dayOfYear) {
|
|
4015
|
-
return dayOfYear >= 1 && dayOfYear <= (isLeapYearIndex$1(year) ? 366 : 365);
|
|
4016
|
-
}
|
|
4017
|
-
function validateWeekDate$1(_year, week, day) {
|
|
4018
|
-
return week >= 1 && week <= 53 && day >= 0 && day <= 6;
|
|
4019
|
-
}
|
|
4020
|
-
function validateTime$1(hours, minutes, seconds) {
|
|
4021
|
-
if (hours === 24) {
|
|
4022
|
-
return minutes === 0 && seconds === 0;
|
|
4023
|
-
}
|
|
4024
|
-
return seconds >= 0 && seconds < 60 && minutes >= 0 && minutes < 60 && hours >= 0 && hours < 25;
|
|
4025
|
-
}
|
|
4026
|
-
function validateTimezone$1(_hours, minutes) {
|
|
4027
|
-
return minutes >= 0 && minutes <= 59;
|
|
4028
|
-
}
|
|
4029
|
-
var toIntegerExports = {};
|
|
4030
|
-
var toInteger$1 = {
|
|
4031
|
-
get exports() {
|
|
4032
|
-
return toIntegerExports;
|
|
4033
|
-
},
|
|
4034
|
-
set exports(v2) {
|
|
4035
|
-
toIntegerExports = v2;
|
|
4036
|
-
}
|
|
4037
|
-
};
|
|
4038
|
-
(function(module, exports) {
|
|
4039
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4040
|
-
value: true
|
|
4041
|
-
});
|
|
4042
|
-
exports.default = toInteger2;
|
|
4043
|
-
function toInteger2(dirtyNumber) {
|
|
4044
|
-
if (dirtyNumber === null || dirtyNumber === true || dirtyNumber === false) {
|
|
4045
|
-
return NaN;
|
|
4046
|
-
}
|
|
4047
|
-
var number = Number(dirtyNumber);
|
|
4048
|
-
if (isNaN(number)) {
|
|
4049
|
-
return number;
|
|
4050
|
-
}
|
|
4051
|
-
return number < 0 ? Math.ceil(number) : Math.floor(number);
|
|
4052
|
-
}
|
|
4053
|
-
module.exports = exports.default;
|
|
4054
|
-
})(toInteger$1, toIntegerExports);
|
|
4055
|
-
const toInteger = /* @__PURE__ */ getDefaultExportFromCjs(toIntegerExports);
|
|
4056
|
-
var getTimezoneOffsetInMillisecondsExports = {};
|
|
4057
|
-
var getTimezoneOffsetInMilliseconds$1 = {
|
|
4058
|
-
get exports() {
|
|
4059
|
-
return getTimezoneOffsetInMillisecondsExports;
|
|
4060
|
-
},
|
|
4061
|
-
set exports(v2) {
|
|
4062
|
-
getTimezoneOffsetInMillisecondsExports = v2;
|
|
4063
|
-
}
|
|
4064
|
-
};
|
|
4065
|
-
(function(module, exports) {
|
|
4066
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4067
|
-
value: true
|
|
4068
|
-
});
|
|
4069
|
-
exports.default = getTimezoneOffsetInMilliseconds2;
|
|
4070
|
-
function getTimezoneOffsetInMilliseconds2(date) {
|
|
4071
|
-
var utcDate = new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds()));
|
|
4072
|
-
utcDate.setUTCFullYear(date.getFullYear());
|
|
4073
|
-
return date.getTime() - utcDate.getTime();
|
|
4074
|
-
}
|
|
4075
|
-
module.exports = exports.default;
|
|
4076
|
-
})(getTimezoneOffsetInMilliseconds$1, getTimezoneOffsetInMillisecondsExports);
|
|
4077
|
-
const getTimezoneOffsetInMilliseconds = /* @__PURE__ */ getDefaultExportFromCjs(getTimezoneOffsetInMillisecondsExports);
|
|
4078
|
-
function tzTokenizeDate(date, timeZone) {
|
|
4079
|
-
var dtf = getDateTimeFormat(timeZone);
|
|
4080
|
-
return dtf.formatToParts ? partsOffset(dtf, date) : hackyOffset(dtf, date);
|
|
4081
|
-
}
|
|
4082
|
-
var typeToPos = {
|
|
4083
|
-
year: 0,
|
|
4084
|
-
month: 1,
|
|
4085
|
-
day: 2,
|
|
4086
|
-
hour: 3,
|
|
4087
|
-
minute: 4,
|
|
4088
|
-
second: 5
|
|
4089
|
-
};
|
|
4090
|
-
function partsOffset(dtf, date) {
|
|
4091
|
-
try {
|
|
4092
|
-
var formatted = dtf.formatToParts(date);
|
|
4093
|
-
var filled = [];
|
|
4094
|
-
for (var i2 = 0; i2 < formatted.length; i2++) {
|
|
4095
|
-
var pos = typeToPos[formatted[i2].type];
|
|
4096
|
-
if (pos >= 0) {
|
|
4097
|
-
filled[pos] = parseInt(formatted[i2].value, 10);
|
|
4098
|
-
}
|
|
4099
|
-
}
|
|
4100
|
-
return filled;
|
|
4101
|
-
} catch (error) {
|
|
4102
|
-
if (error instanceof RangeError) {
|
|
4103
|
-
return [NaN];
|
|
4104
|
-
}
|
|
4105
|
-
throw error;
|
|
4106
|
-
}
|
|
4107
|
-
}
|
|
4108
|
-
function hackyOffset(dtf, date) {
|
|
4109
|
-
var formatted = dtf.format(date).replace(/\u200E/g, "");
|
|
4110
|
-
var parsed = /(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(formatted);
|
|
4111
|
-
return [parsed[3], parsed[1], parsed[2], parsed[4], parsed[5], parsed[6]];
|
|
4112
|
-
}
|
|
4113
|
-
var dtfCache = {};
|
|
4114
|
-
function getDateTimeFormat(timeZone) {
|
|
4115
|
-
if (!dtfCache[timeZone]) {
|
|
4116
|
-
var testDateFormatted = new Intl.DateTimeFormat("en-US", {
|
|
4117
|
-
hour12: false,
|
|
4118
|
-
timeZone: "America/New_York",
|
|
4119
|
-
year: "numeric",
|
|
4120
|
-
month: "numeric",
|
|
4121
|
-
day: "2-digit",
|
|
4122
|
-
hour: "2-digit",
|
|
4123
|
-
minute: "2-digit",
|
|
4124
|
-
second: "2-digit"
|
|
4125
|
-
}).format(new Date("2014-06-25T04:00:00.123Z"));
|
|
4126
|
-
var hourCycleSupported = testDateFormatted === "06/25/2014, 00:00:00" || testDateFormatted === "06/25/2014 00:00:00";
|
|
4127
|
-
dtfCache[timeZone] = hourCycleSupported ? new Intl.DateTimeFormat("en-US", {
|
|
4128
|
-
hour12: false,
|
|
4129
|
-
timeZone,
|
|
4130
|
-
year: "numeric",
|
|
4131
|
-
month: "numeric",
|
|
4132
|
-
day: "2-digit",
|
|
4133
|
-
hour: "2-digit",
|
|
4134
|
-
minute: "2-digit",
|
|
4135
|
-
second: "2-digit"
|
|
4136
|
-
}) : new Intl.DateTimeFormat("en-US", {
|
|
4137
|
-
hourCycle: "h23",
|
|
4138
|
-
timeZone,
|
|
4139
|
-
year: "numeric",
|
|
4140
|
-
month: "numeric",
|
|
4141
|
-
day: "2-digit",
|
|
4142
|
-
hour: "2-digit",
|
|
4143
|
-
minute: "2-digit",
|
|
4144
|
-
second: "2-digit"
|
|
4145
|
-
});
|
|
4146
|
-
}
|
|
4147
|
-
return dtfCache[timeZone];
|
|
4148
|
-
}
|
|
4149
|
-
function newDateUTC(fullYear, month, day, hour, minute, second, millisecond) {
|
|
4150
|
-
var utcDate = new Date(0);
|
|
4151
|
-
utcDate.setUTCFullYear(fullYear, month, day);
|
|
4152
|
-
utcDate.setUTCHours(hour, minute, second, millisecond);
|
|
4153
|
-
return utcDate;
|
|
4154
|
-
}
|
|
4155
|
-
var MILLISECONDS_IN_HOUR$1 = 36e5;
|
|
4156
|
-
var MILLISECONDS_IN_MINUTE$1 = 6e4;
|
|
4157
|
-
var patterns$1 = {
|
|
4158
|
-
timezone: /([Z+-].*)$/,
|
|
4159
|
-
timezoneZ: /^(Z)$/,
|
|
4160
|
-
timezoneHH: /^([+-]\d{2})$/,
|
|
4161
|
-
timezoneHHMM: /^([+-]\d{2}):?(\d{2})$/
|
|
4162
|
-
};
|
|
4163
|
-
function tzParseTimezone(timezoneString, date, isUtcDate) {
|
|
4164
|
-
var token;
|
|
4165
|
-
var absoluteOffset;
|
|
4166
|
-
if (!timezoneString) {
|
|
4167
|
-
return 0;
|
|
4168
|
-
}
|
|
4169
|
-
token = patterns$1.timezoneZ.exec(timezoneString);
|
|
4170
|
-
if (token) {
|
|
4171
|
-
return 0;
|
|
4172
|
-
}
|
|
4173
|
-
var hours;
|
|
4174
|
-
token = patterns$1.timezoneHH.exec(timezoneString);
|
|
4175
|
-
if (token) {
|
|
4176
|
-
hours = parseInt(token[1], 10);
|
|
4177
|
-
if (!validateTimezone(hours)) {
|
|
4178
|
-
return NaN;
|
|
4179
|
-
}
|
|
4180
|
-
return -(hours * MILLISECONDS_IN_HOUR$1);
|
|
4181
|
-
}
|
|
4182
|
-
token = patterns$1.timezoneHHMM.exec(timezoneString);
|
|
4183
|
-
if (token) {
|
|
4184
|
-
hours = parseInt(token[1], 10);
|
|
4185
|
-
var minutes = parseInt(token[2], 10);
|
|
4186
|
-
if (!validateTimezone(hours, minutes)) {
|
|
4187
|
-
return NaN;
|
|
4188
|
-
}
|
|
4189
|
-
absoluteOffset = Math.abs(hours) * MILLISECONDS_IN_HOUR$1 + minutes * MILLISECONDS_IN_MINUTE$1;
|
|
4190
|
-
return hours > 0 ? -absoluteOffset : absoluteOffset;
|
|
4191
|
-
}
|
|
4192
|
-
if (isValidTimezoneIANAString(timezoneString)) {
|
|
4193
|
-
date = new Date(date || Date.now());
|
|
4194
|
-
var utcDate = isUtcDate ? date : toUtcDate(date);
|
|
4195
|
-
var offset = calcOffset(utcDate, timezoneString);
|
|
4196
|
-
var fixedOffset = isUtcDate ? offset : fixOffset(date, offset, timezoneString);
|
|
4197
|
-
return -fixedOffset;
|
|
4198
|
-
}
|
|
4199
|
-
return NaN;
|
|
4200
|
-
}
|
|
4201
|
-
function toUtcDate(date) {
|
|
4202
|
-
return newDateUTC(
|
|
4203
|
-
date.getFullYear(),
|
|
4204
|
-
date.getMonth(),
|
|
4205
|
-
date.getDate(),
|
|
4206
|
-
date.getHours(),
|
|
4207
|
-
date.getMinutes(),
|
|
4208
|
-
date.getSeconds(),
|
|
4209
|
-
date.getMilliseconds()
|
|
4210
|
-
);
|
|
4211
|
-
}
|
|
4212
|
-
function calcOffset(date, timezoneString) {
|
|
4213
|
-
var tokens = tzTokenizeDate(date, timezoneString);
|
|
4214
|
-
var asUTC = newDateUTC(
|
|
4215
|
-
tokens[0],
|
|
4216
|
-
tokens[1] - 1,
|
|
4217
|
-
tokens[2],
|
|
4218
|
-
tokens[3] % 24,
|
|
4219
|
-
tokens[4],
|
|
4220
|
-
tokens[5],
|
|
4221
|
-
0
|
|
4222
|
-
).getTime();
|
|
4223
|
-
var asTS = date.getTime();
|
|
4224
|
-
var over = asTS % 1e3;
|
|
4225
|
-
asTS -= over >= 0 ? over : 1e3 + over;
|
|
4226
|
-
return asUTC - asTS;
|
|
4227
|
-
}
|
|
4228
|
-
function fixOffset(date, offset, timezoneString) {
|
|
4229
|
-
var localTS = date.getTime();
|
|
4230
|
-
var utcGuess = localTS - offset;
|
|
4231
|
-
var o2 = calcOffset(new Date(utcGuess), timezoneString);
|
|
4232
|
-
if (offset === o2) {
|
|
4233
|
-
return offset;
|
|
4234
|
-
}
|
|
4235
|
-
utcGuess -= o2 - offset;
|
|
4236
|
-
var o3 = calcOffset(new Date(utcGuess), timezoneString);
|
|
4237
|
-
if (o2 === o3) {
|
|
4238
|
-
return o2;
|
|
4239
|
-
}
|
|
4240
|
-
return Math.max(o2, o3);
|
|
4241
|
-
}
|
|
4242
|
-
function validateTimezone(hours, minutes) {
|
|
4243
|
-
return -23 <= hours && hours <= 23 && (minutes == null || 0 <= minutes && minutes <= 59);
|
|
4244
|
-
}
|
|
4245
|
-
var validIANATimezoneCache = {};
|
|
4246
|
-
function isValidTimezoneIANAString(timeZoneString) {
|
|
4247
|
-
if (validIANATimezoneCache[timeZoneString])
|
|
4248
|
-
return true;
|
|
4249
|
-
try {
|
|
4250
|
-
new Intl.DateTimeFormat(void 0, { timeZone: timeZoneString });
|
|
4251
|
-
validIANATimezoneCache[timeZoneString] = true;
|
|
4252
|
-
return true;
|
|
4253
|
-
} catch (error) {
|
|
4254
|
-
return false;
|
|
4255
|
-
}
|
|
4256
|
-
}
|
|
4257
|
-
var tzPattern = /(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/;
|
|
4258
|
-
const tzPattern$1 = tzPattern;
|
|
4259
|
-
var MILLISECONDS_IN_HOUR = 36e5;
|
|
4260
|
-
var MILLISECONDS_IN_MINUTE = 6e4;
|
|
4261
|
-
var DEFAULT_ADDITIONAL_DIGITS = 2;
|
|
4262
|
-
var patterns = {
|
|
4263
|
-
dateTimePattern: /^([0-9W+-]+)(T| )(.*)/,
|
|
4264
|
-
datePattern: /^([0-9W+-]+)(.*)/,
|
|
4265
|
-
plainTime: /:/,
|
|
4266
|
-
// year tokens
|
|
4267
|
-
YY: /^(\d{2})$/,
|
|
4268
|
-
YYY: [
|
|
4269
|
-
/^([+-]\d{2})$/,
|
|
4270
|
-
// 0 additional digits
|
|
4271
|
-
/^([+-]\d{3})$/,
|
|
4272
|
-
// 1 additional digit
|
|
4273
|
-
/^([+-]\d{4})$/
|
|
4274
|
-
// 2 additional digits
|
|
4275
|
-
],
|
|
4276
|
-
YYYY: /^(\d{4})/,
|
|
4277
|
-
YYYYY: [
|
|
4278
|
-
/^([+-]\d{4})/,
|
|
4279
|
-
// 0 additional digits
|
|
4280
|
-
/^([+-]\d{5})/,
|
|
4281
|
-
// 1 additional digit
|
|
4282
|
-
/^([+-]\d{6})/
|
|
4283
|
-
// 2 additional digits
|
|
4284
|
-
],
|
|
4285
|
-
// date tokens
|
|
4286
|
-
MM: /^-(\d{2})$/,
|
|
4287
|
-
DDD: /^-?(\d{3})$/,
|
|
4288
|
-
MMDD: /^-?(\d{2})-?(\d{2})$/,
|
|
4289
|
-
Www: /^-?W(\d{2})$/,
|
|
4290
|
-
WwwD: /^-?W(\d{2})-?(\d{1})$/,
|
|
4291
|
-
HH: /^(\d{2}([.,]\d*)?)$/,
|
|
4292
|
-
HHMM: /^(\d{2}):?(\d{2}([.,]\d*)?)$/,
|
|
4293
|
-
HHMMSS: /^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/,
|
|
4294
|
-
// time zone tokens (to identify the presence of a tz)
|
|
4295
|
-
timeZone: tzPattern$1
|
|
4296
|
-
};
|
|
4297
|
-
function toDate(argument, dirtyOptions) {
|
|
4298
|
-
if (arguments.length < 1) {
|
|
4299
|
-
throw new TypeError("1 argument required, but only " + arguments.length + " present");
|
|
4300
|
-
}
|
|
4301
|
-
if (argument === null) {
|
|
4302
|
-
return new Date(NaN);
|
|
4303
|
-
}
|
|
4304
|
-
var options = dirtyOptions || {};
|
|
4305
|
-
var additionalDigits = options.additionalDigits == null ? DEFAULT_ADDITIONAL_DIGITS : toInteger(options.additionalDigits);
|
|
4306
|
-
if (additionalDigits !== 2 && additionalDigits !== 1 && additionalDigits !== 0) {
|
|
4307
|
-
throw new RangeError("additionalDigits must be 0, 1 or 2");
|
|
4308
|
-
}
|
|
4309
|
-
if (argument instanceof Date || typeof argument === "object" && Object.prototype.toString.call(argument) === "[object Date]") {
|
|
4310
|
-
return new Date(argument.getTime());
|
|
4311
|
-
} else if (typeof argument === "number" || Object.prototype.toString.call(argument) === "[object Number]") {
|
|
4312
|
-
return new Date(argument);
|
|
4313
|
-
} else if (!(typeof argument === "string" || Object.prototype.toString.call(argument) === "[object String]")) {
|
|
4314
|
-
return new Date(NaN);
|
|
4315
|
-
}
|
|
4316
|
-
var dateStrings = splitDateString(argument);
|
|
4317
|
-
var parseYearResult = parseYear(dateStrings.date, additionalDigits);
|
|
4318
|
-
var year = parseYearResult.year;
|
|
4319
|
-
var restDateString = parseYearResult.restDateString;
|
|
4320
|
-
var date = parseDate(restDateString, year);
|
|
4321
|
-
if (isNaN(date)) {
|
|
4322
|
-
return new Date(NaN);
|
|
4323
|
-
}
|
|
4324
|
-
if (date) {
|
|
4325
|
-
var timestamp = date.getTime();
|
|
4326
|
-
var time = 0;
|
|
4327
|
-
var offset;
|
|
4328
|
-
if (dateStrings.time) {
|
|
4329
|
-
time = parseTime(dateStrings.time);
|
|
4330
|
-
if (isNaN(time)) {
|
|
4331
|
-
return new Date(NaN);
|
|
4332
|
-
}
|
|
4333
|
-
}
|
|
4334
|
-
if (dateStrings.timeZone || options.timeZone) {
|
|
4335
|
-
offset = tzParseTimezone(dateStrings.timeZone || options.timeZone, new Date(timestamp + time));
|
|
4336
|
-
if (isNaN(offset)) {
|
|
4337
|
-
return new Date(NaN);
|
|
4338
|
-
}
|
|
4339
|
-
} else {
|
|
4340
|
-
offset = getTimezoneOffsetInMilliseconds(new Date(timestamp + time));
|
|
4341
|
-
offset = getTimezoneOffsetInMilliseconds(new Date(timestamp + time + offset));
|
|
4342
|
-
}
|
|
4343
|
-
return new Date(timestamp + time + offset);
|
|
4344
|
-
} else {
|
|
4345
|
-
return new Date(NaN);
|
|
4346
|
-
}
|
|
4347
|
-
}
|
|
4348
|
-
function splitDateString(dateString) {
|
|
4349
|
-
var dateStrings = {};
|
|
4350
|
-
var parts = patterns.dateTimePattern.exec(dateString);
|
|
4351
|
-
var timeString;
|
|
4352
|
-
if (!parts) {
|
|
4353
|
-
parts = patterns.datePattern.exec(dateString);
|
|
4354
|
-
if (parts) {
|
|
4355
|
-
dateStrings.date = parts[1];
|
|
4356
|
-
timeString = parts[2];
|
|
4357
|
-
} else {
|
|
4358
|
-
dateStrings.date = null;
|
|
4359
|
-
timeString = dateString;
|
|
4360
|
-
}
|
|
4361
|
-
} else {
|
|
4362
|
-
dateStrings.date = parts[1];
|
|
4363
|
-
timeString = parts[3];
|
|
4364
|
-
}
|
|
4365
|
-
if (timeString) {
|
|
4366
|
-
var token = patterns.timeZone.exec(timeString);
|
|
4367
|
-
if (token) {
|
|
4368
|
-
dateStrings.time = timeString.replace(token[1], "");
|
|
4369
|
-
dateStrings.timeZone = token[1].trim();
|
|
4370
|
-
} else {
|
|
4371
|
-
dateStrings.time = timeString;
|
|
4372
|
-
}
|
|
4373
|
-
}
|
|
4374
|
-
return dateStrings;
|
|
4375
|
-
}
|
|
4376
|
-
function parseYear(dateString, additionalDigits) {
|
|
4377
|
-
var patternYYY = patterns.YYY[additionalDigits];
|
|
4378
|
-
var patternYYYYY = patterns.YYYYY[additionalDigits];
|
|
4379
|
-
var token;
|
|
4380
|
-
token = patterns.YYYY.exec(dateString) || patternYYYYY.exec(dateString);
|
|
4381
|
-
if (token) {
|
|
4382
|
-
var yearString = token[1];
|
|
4383
|
-
return {
|
|
4384
|
-
year: parseInt(yearString, 10),
|
|
4385
|
-
restDateString: dateString.slice(yearString.length)
|
|
4386
|
-
};
|
|
4387
|
-
}
|
|
4388
|
-
token = patterns.YY.exec(dateString) || patternYYY.exec(dateString);
|
|
4389
|
-
if (token) {
|
|
4390
|
-
var centuryString = token[1];
|
|
4391
|
-
return {
|
|
4392
|
-
year: parseInt(centuryString, 10) * 100,
|
|
4393
|
-
restDateString: dateString.slice(centuryString.length)
|
|
4394
|
-
};
|
|
4395
|
-
}
|
|
4396
|
-
return {
|
|
4397
|
-
year: null
|
|
4398
|
-
};
|
|
4399
|
-
}
|
|
4400
|
-
function parseDate(dateString, year) {
|
|
4401
|
-
if (year === null) {
|
|
4402
|
-
return null;
|
|
4403
|
-
}
|
|
4404
|
-
var token;
|
|
4405
|
-
var date;
|
|
4406
|
-
var month;
|
|
4407
|
-
var week;
|
|
4408
|
-
if (dateString.length === 0) {
|
|
4409
|
-
date = new Date(0);
|
|
4410
|
-
date.setUTCFullYear(year);
|
|
4411
|
-
return date;
|
|
4412
|
-
}
|
|
4413
|
-
token = patterns.MM.exec(dateString);
|
|
4414
|
-
if (token) {
|
|
4415
|
-
date = new Date(0);
|
|
4416
|
-
month = parseInt(token[1], 10) - 1;
|
|
4417
|
-
if (!validateDate(year, month)) {
|
|
4418
|
-
return new Date(NaN);
|
|
4419
|
-
}
|
|
4420
|
-
date.setUTCFullYear(year, month);
|
|
4421
|
-
return date;
|
|
4422
|
-
}
|
|
4423
|
-
token = patterns.DDD.exec(dateString);
|
|
4424
|
-
if (token) {
|
|
4425
|
-
date = new Date(0);
|
|
4426
|
-
var dayOfYear = parseInt(token[1], 10);
|
|
4427
|
-
if (!validateDayOfYearDate(year, dayOfYear)) {
|
|
4428
|
-
return new Date(NaN);
|
|
4429
|
-
}
|
|
4430
|
-
date.setUTCFullYear(year, 0, dayOfYear);
|
|
4431
|
-
return date;
|
|
4432
|
-
}
|
|
4433
|
-
token = patterns.MMDD.exec(dateString);
|
|
4434
|
-
if (token) {
|
|
4435
|
-
date = new Date(0);
|
|
4436
|
-
month = parseInt(token[1], 10) - 1;
|
|
4437
|
-
var day = parseInt(token[2], 10);
|
|
4438
|
-
if (!validateDate(year, month, day)) {
|
|
4439
|
-
return new Date(NaN);
|
|
4440
|
-
}
|
|
4441
|
-
date.setUTCFullYear(year, month, day);
|
|
4442
|
-
return date;
|
|
4443
|
-
}
|
|
4444
|
-
token = patterns.Www.exec(dateString);
|
|
4445
|
-
if (token) {
|
|
4446
|
-
week = parseInt(token[1], 10) - 1;
|
|
4447
|
-
if (!validateWeekDate(year, week)) {
|
|
4448
|
-
return new Date(NaN);
|
|
4449
|
-
}
|
|
4450
|
-
return dayOfISOWeekYear(year, week);
|
|
4451
|
-
}
|
|
4452
|
-
token = patterns.WwwD.exec(dateString);
|
|
4453
|
-
if (token) {
|
|
4454
|
-
week = parseInt(token[1], 10) - 1;
|
|
4455
|
-
var dayOfWeek = parseInt(token[2], 10) - 1;
|
|
4456
|
-
if (!validateWeekDate(year, week, dayOfWeek)) {
|
|
4457
|
-
return new Date(NaN);
|
|
4458
|
-
}
|
|
4459
|
-
return dayOfISOWeekYear(year, week, dayOfWeek);
|
|
4460
|
-
}
|
|
4461
|
-
return null;
|
|
4462
|
-
}
|
|
4463
|
-
function parseTime(timeString) {
|
|
4464
|
-
var token;
|
|
4465
|
-
var hours;
|
|
4466
|
-
var minutes;
|
|
4467
|
-
token = patterns.HH.exec(timeString);
|
|
4468
|
-
if (token) {
|
|
4469
|
-
hours = parseFloat(token[1].replace(",", "."));
|
|
4470
|
-
if (!validateTime(hours)) {
|
|
4471
|
-
return NaN;
|
|
4472
|
-
}
|
|
4473
|
-
return hours % 24 * MILLISECONDS_IN_HOUR;
|
|
4474
|
-
}
|
|
4475
|
-
token = patterns.HHMM.exec(timeString);
|
|
4476
|
-
if (token) {
|
|
4477
|
-
hours = parseInt(token[1], 10);
|
|
4478
|
-
minutes = parseFloat(token[2].replace(",", "."));
|
|
4479
|
-
if (!validateTime(hours, minutes)) {
|
|
4480
|
-
return NaN;
|
|
4481
|
-
}
|
|
4482
|
-
return hours % 24 * MILLISECONDS_IN_HOUR + minutes * MILLISECONDS_IN_MINUTE;
|
|
4483
|
-
}
|
|
4484
|
-
token = patterns.HHMMSS.exec(timeString);
|
|
4485
|
-
if (token) {
|
|
4486
|
-
hours = parseInt(token[1], 10);
|
|
4487
|
-
minutes = parseInt(token[2], 10);
|
|
4488
|
-
var seconds = parseFloat(token[3].replace(",", "."));
|
|
4489
|
-
if (!validateTime(hours, minutes, seconds)) {
|
|
4490
|
-
return NaN;
|
|
4491
|
-
}
|
|
4492
|
-
return hours % 24 * MILLISECONDS_IN_HOUR + minutes * MILLISECONDS_IN_MINUTE + seconds * 1e3;
|
|
4493
|
-
}
|
|
4494
|
-
return null;
|
|
4495
|
-
}
|
|
4496
|
-
function dayOfISOWeekYear(isoWeekYear, week, day) {
|
|
4497
|
-
week = week || 0;
|
|
4498
|
-
day = day || 0;
|
|
4499
|
-
var date = new Date(0);
|
|
4500
|
-
date.setUTCFullYear(isoWeekYear, 0, 4);
|
|
4501
|
-
var fourthOfJanuaryDay = date.getUTCDay() || 7;
|
|
4502
|
-
var diff = week * 7 + day + 1 - fourthOfJanuaryDay;
|
|
4503
|
-
date.setUTCDate(date.getUTCDate() + diff);
|
|
4504
|
-
return date;
|
|
4505
|
-
}
|
|
4506
|
-
var DAYS_IN_MONTH = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
|
|
4507
|
-
var DAYS_IN_MONTH_LEAP_YEAR = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
|
|
4508
|
-
function isLeapYearIndex(year) {
|
|
4509
|
-
return year % 400 === 0 || year % 4 === 0 && year % 100 !== 0;
|
|
3615
|
+
function endOfToday() {
|
|
3616
|
+
return endOfDay(Date.now());
|
|
4510
3617
|
}
|
|
4511
|
-
function
|
|
4512
|
-
|
|
4513
|
-
return false;
|
|
4514
|
-
}
|
|
4515
|
-
if (date != null) {
|
|
4516
|
-
if (date < 1) {
|
|
4517
|
-
return false;
|
|
4518
|
-
}
|
|
4519
|
-
var isLeapYear = isLeapYearIndex(year);
|
|
4520
|
-
if (isLeapYear && date > DAYS_IN_MONTH_LEAP_YEAR[month]) {
|
|
4521
|
-
return false;
|
|
4522
|
-
}
|
|
4523
|
-
if (!isLeapYear && date > DAYS_IN_MONTH[month]) {
|
|
4524
|
-
return false;
|
|
4525
|
-
}
|
|
4526
|
-
}
|
|
4527
|
-
return true;
|
|
4528
|
-
}
|
|
4529
|
-
function validateDayOfYearDate(year, dayOfYear) {
|
|
4530
|
-
if (dayOfYear < 1) {
|
|
4531
|
-
return false;
|
|
4532
|
-
}
|
|
4533
|
-
var isLeapYear = isLeapYearIndex(year);
|
|
4534
|
-
if (isLeapYear && dayOfYear > 366) {
|
|
4535
|
-
return false;
|
|
4536
|
-
}
|
|
4537
|
-
if (!isLeapYear && dayOfYear > 365) {
|
|
4538
|
-
return false;
|
|
4539
|
-
}
|
|
4540
|
-
return true;
|
|
4541
|
-
}
|
|
4542
|
-
function validateWeekDate(year, week, day) {
|
|
4543
|
-
if (week < 0 || week > 52) {
|
|
4544
|
-
return false;
|
|
4545
|
-
}
|
|
4546
|
-
if (day != null && (day < 0 || day > 6)) {
|
|
4547
|
-
return false;
|
|
4548
|
-
}
|
|
4549
|
-
return true;
|
|
4550
|
-
}
|
|
4551
|
-
function validateTime(hours, minutes, seconds) {
|
|
4552
|
-
if (hours != null && (hours < 0 || hours >= 25)) {
|
|
4553
|
-
return false;
|
|
4554
|
-
}
|
|
4555
|
-
if (minutes != null && (minutes < 0 || minutes >= 60)) {
|
|
4556
|
-
return false;
|
|
4557
|
-
}
|
|
4558
|
-
if (seconds != null && (seconds < 0 || seconds >= 60)) {
|
|
4559
|
-
return false;
|
|
4560
|
-
}
|
|
4561
|
-
return true;
|
|
4562
|
-
}
|
|
4563
|
-
var cloneObjectExports = {};
|
|
4564
|
-
var cloneObject$1 = {
|
|
4565
|
-
get exports() {
|
|
4566
|
-
return cloneObjectExports;
|
|
4567
|
-
},
|
|
4568
|
-
set exports(v2) {
|
|
4569
|
-
cloneObjectExports = v2;
|
|
4570
|
-
}
|
|
4571
|
-
};
|
|
4572
|
-
var assignExports = {};
|
|
4573
|
-
var assign = {
|
|
4574
|
-
get exports() {
|
|
4575
|
-
return assignExports;
|
|
4576
|
-
},
|
|
4577
|
-
set exports(v2) {
|
|
4578
|
-
assignExports = v2;
|
|
4579
|
-
}
|
|
4580
|
-
};
|
|
4581
|
-
(function(module, exports) {
|
|
4582
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4583
|
-
value: true
|
|
4584
|
-
});
|
|
4585
|
-
exports.default = assign2;
|
|
4586
|
-
function assign2(target, object) {
|
|
4587
|
-
if (target == null) {
|
|
4588
|
-
throw new TypeError("assign requires that input parameter not be null or undefined");
|
|
4589
|
-
}
|
|
4590
|
-
for (var property in object) {
|
|
4591
|
-
if (Object.prototype.hasOwnProperty.call(object, property)) {
|
|
4592
|
-
target[property] = object[property];
|
|
4593
|
-
}
|
|
4594
|
-
}
|
|
4595
|
-
return target;
|
|
4596
|
-
}
|
|
4597
|
-
module.exports = exports.default;
|
|
4598
|
-
})(assign, assignExports);
|
|
4599
|
-
(function(module, exports) {
|
|
4600
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4601
|
-
value: true
|
|
4602
|
-
});
|
|
4603
|
-
exports.default = cloneObject2;
|
|
4604
|
-
var _index = _interopRequireDefault(assignExports);
|
|
4605
|
-
function _interopRequireDefault(obj) {
|
|
4606
|
-
return obj && obj.__esModule ? obj : { default: obj };
|
|
4607
|
-
}
|
|
4608
|
-
function cloneObject2(object) {
|
|
4609
|
-
return (0, _index.default)({}, object);
|
|
4610
|
-
}
|
|
4611
|
-
module.exports = exports.default;
|
|
4612
|
-
})(cloneObject$1, cloneObjectExports);
|
|
4613
|
-
const cloneObject = /* @__PURE__ */ getDefaultExportFromCjs(cloneObjectExports);
|
|
4614
|
-
function utcToZonedTime(dirtyDate, timeZone, options) {
|
|
4615
|
-
var date = toDate(dirtyDate, options);
|
|
4616
|
-
var offsetMilliseconds = tzParseTimezone(timeZone, date, true);
|
|
4617
|
-
var d2 = new Date(date.getTime() - offsetMilliseconds);
|
|
4618
|
-
var resultDate = new Date(0);
|
|
4619
|
-
resultDate.setFullYear(d2.getUTCFullYear(), d2.getUTCMonth(), d2.getUTCDate());
|
|
4620
|
-
resultDate.setHours(d2.getUTCHours(), d2.getUTCMinutes(), d2.getUTCSeconds(), d2.getUTCMilliseconds());
|
|
4621
|
-
return resultDate;
|
|
4622
|
-
}
|
|
4623
|
-
function zonedTimeToUtc(date, timeZone, options) {
|
|
4624
|
-
if (typeof date === "string" && !date.match(tzPattern$1)) {
|
|
4625
|
-
var extendedOptions = cloneObject(options);
|
|
4626
|
-
extendedOptions.timeZone = timeZone;
|
|
4627
|
-
return toDate(date, extendedOptions);
|
|
4628
|
-
}
|
|
4629
|
-
var d2 = toDate(date, options);
|
|
4630
|
-
var utc = newDateUTC(
|
|
4631
|
-
d2.getFullYear(),
|
|
4632
|
-
d2.getMonth(),
|
|
4633
|
-
d2.getDate(),
|
|
4634
|
-
d2.getHours(),
|
|
4635
|
-
d2.getMinutes(),
|
|
4636
|
-
d2.getSeconds(),
|
|
4637
|
-
d2.getMilliseconds()
|
|
4638
|
-
).getTime();
|
|
4639
|
-
var offsetMilliseconds = tzParseTimezone(timeZone, new Date(utc));
|
|
4640
|
-
return new Date(utc + offsetMilliseconds);
|
|
4641
|
-
}
|
|
4642
|
-
const zone = "Asia/Jakarta";
|
|
4643
|
-
dayjs.locale("id");
|
|
4644
|
-
class PeriodUtil {
|
|
4645
|
-
static getStartOfDay(date) {
|
|
4646
|
-
const _date = parseISO(date);
|
|
4647
|
-
const _dateZoned = utcToZonedTime(_date, zone);
|
|
4648
|
-
const _dateResult = startOfDay(_dateZoned);
|
|
4649
|
-
return zonedTimeToUtc(_dateResult, zone);
|
|
4650
|
-
}
|
|
4651
|
-
static getEndOfDay(date) {
|
|
4652
|
-
const _date = parseISO(date);
|
|
4653
|
-
const _dateZoned = utcToZonedTime(_date, zone);
|
|
4654
|
-
const _dateResult = endOfDay(_dateZoned);
|
|
4655
|
-
return zonedTimeToUtc(_dateResult, zone);
|
|
4656
|
-
}
|
|
4657
|
-
static getPeriodFilter(keyStart, startedAt, keyEnd, endedAt) {
|
|
4658
|
-
const start2 = this.getStartOfDay(startedAt);
|
|
4659
|
-
const end = this.getEndOfDay(endedAt || startedAt);
|
|
4660
|
-
const filter = [
|
|
4661
|
-
{ [keyStart]: { $gte: start2 } },
|
|
4662
|
-
{ [keyEnd || keyStart]: { $lte: end } }
|
|
4663
|
-
];
|
|
4664
|
-
return filter;
|
|
4665
|
-
}
|
|
4666
|
-
static getPastPeriodFilter(key, startedAt) {
|
|
4667
|
-
const start2 = this.getStartOfDay(startedAt);
|
|
4668
|
-
const filter = [{ [key]: { $lt: start2 } }];
|
|
4669
|
-
return filter;
|
|
4670
|
-
}
|
|
3618
|
+
function startOfToday() {
|
|
3619
|
+
return startOfDay(Date.now());
|
|
4671
3620
|
}
|
|
4672
3621
|
const useOperasionalStore = defineStore("neu:operasional", () => {
|
|
4673
3622
|
const isLoading = ref(false);
|
|
@@ -4807,7 +3756,7 @@ function mitt(n) {
|
|
|
4807
3756
|
} };
|
|
4808
3757
|
}
|
|
4809
3758
|
const bus = mitt();
|
|
4810
|
-
const _withScopeId$2 = (n) => (pushScopeId("data-v-
|
|
3759
|
+
const _withScopeId$2 = (n) => (pushScopeId("data-v-3ba48e60"), n = n(), popScopeId(), n);
|
|
4811
3760
|
const _hoisted_1$7 = { id: "view-checkIns" };
|
|
4812
3761
|
const _hoisted_2$4 = { class: "summary" };
|
|
4813
3762
|
const _hoisted_3$1 = { class: "wrapper" };
|
|
@@ -4824,18 +3773,32 @@ const _hoisted_5 = /* @__PURE__ */ _withScopeId$2(() => /* @__PURE__ */ createEl
|
|
|
4824
3773
|
));
|
|
4825
3774
|
const _hoisted_6 = { class: "end" };
|
|
4826
3775
|
const __default__$7 = defineComponent({
|
|
4827
|
-
name: "
|
|
3776
|
+
name: "CheckInPresenceCollection"
|
|
4828
3777
|
});
|
|
4829
3778
|
const _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
4830
3779
|
...__default__$7,
|
|
4831
3780
|
setup(__props) {
|
|
3781
|
+
const collectionBus = useEventBus("neu:tempat:checkIn");
|
|
4832
3782
|
const { client } = useClientHandle();
|
|
4833
|
-
useAuthStore();
|
|
4834
3783
|
const { staff } = useOperasional();
|
|
4835
3784
|
const attendanceStore = useAttendanceStore();
|
|
4836
3785
|
const { isAsking, isScanning, isEntering, isScanError, isScanned, type } = storeToRefs(attendanceStore);
|
|
4837
3786
|
const toast = useToastStore();
|
|
4838
3787
|
const isCheckpoint = ref(false);
|
|
3788
|
+
collectionBus.on((event, payload) => {
|
|
3789
|
+
if (isCheckpoint.value === true) {
|
|
3790
|
+
if (event === "createOne:ok") {
|
|
3791
|
+
const toastId = "neu:personalia:staff:checkIn";
|
|
3792
|
+
toast.push({
|
|
3793
|
+
id: toastId,
|
|
3794
|
+
icon: "check",
|
|
3795
|
+
content: "Presensi berhasil.",
|
|
3796
|
+
color: "success"
|
|
3797
|
+
});
|
|
3798
|
+
isCheckpoint.value = false;
|
|
3799
|
+
}
|
|
3800
|
+
}
|
|
3801
|
+
});
|
|
4839
3802
|
const query = computed(() => {
|
|
4840
3803
|
var _a;
|
|
4841
3804
|
return Query.define({
|
|
@@ -4843,8 +3806,13 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
|
4843
3806
|
handle: "",
|
|
4844
3807
|
operator: "mongo",
|
|
4845
3808
|
value: {
|
|
4846
|
-
staffId:
|
|
4847
|
-
$and: PeriodUtil.getPeriodFilter(
|
|
3809
|
+
// staffId: staff.value?.id,
|
|
3810
|
+
// $and: PeriodUtil.getPeriodFilter('checkInAt', new Date().toISOString()),
|
|
3811
|
+
$and: [
|
|
3812
|
+
{ staffId: (_a = staff.value) == null ? void 0 : _a.id },
|
|
3813
|
+
{ checkInAt: { $gte: addDays(startOfToday(), 1) } },
|
|
3814
|
+
{ checkInAt: { $lte: endOfToday() } }
|
|
3815
|
+
]
|
|
4848
3816
|
}
|
|
4849
3817
|
}
|
|
4850
3818
|
});
|
|
@@ -4902,6 +3870,7 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
|
4902
3870
|
}
|
|
4903
3871
|
return (_ctx, _cache) => {
|
|
4904
3872
|
const _component_CheckInSingleView = resolveComponent("CheckInSingleView");
|
|
3873
|
+
const _component_CheckInCollection = resolveComponent("CheckInCollection");
|
|
4905
3874
|
return openBlock(), createElementBlock("div", _hoisted_1$7, [
|
|
4906
3875
|
createVNode(unref(OfficeContent), {
|
|
4907
3876
|
icon: "barcode-read",
|
|
@@ -4998,7 +3967,7 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
|
4998
3967
|
isCheckpoint.value ? (openBlock(), createBlock(unref(NeonModal), {
|
|
4999
3968
|
key: 0,
|
|
5000
3969
|
"is-active": "",
|
|
5001
|
-
size: "
|
|
3970
|
+
size: "lg",
|
|
5002
3971
|
onClose: _cache[2] || (_cache[2] = ($event) => isCheckpoint.value = false)
|
|
5003
3972
|
}, {
|
|
5004
3973
|
default: withCtx(() => [
|
|
@@ -5031,6 +4000,7 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
|
5031
4000
|
query: unref(query),
|
|
5032
4001
|
peeks: ["modal"],
|
|
5033
4002
|
excludes: ["create"],
|
|
4003
|
+
columns: ["type", "checkInAt", "staff", "building"],
|
|
5034
4004
|
"is-ready": "",
|
|
5035
4005
|
"is-main": ""
|
|
5036
4006
|
}, {
|
|
@@ -5047,7 +4017,7 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
|
5047
4017
|
})
|
|
5048
4018
|
])
|
|
5049
4019
|
]),
|
|
5050
|
-
createVNode(
|
|
4020
|
+
createVNode(_component_CheckInCollection)
|
|
5051
4021
|
]),
|
|
5052
4022
|
_: 1
|
|
5053
4023
|
/* STABLE */
|
|
@@ -5061,7 +4031,7 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
|
5061
4031
|
};
|
|
5062
4032
|
}
|
|
5063
4033
|
});
|
|
5064
|
-
const
|
|
4034
|
+
const CheckInPresenceCollection_vue_vue_type_style_index_0_scoped_3ba48e60_lang = "";
|
|
5065
4035
|
const _export_sfc = (sfc, props) => {
|
|
5066
4036
|
const target = sfc.__vccOpts || sfc;
|
|
5067
4037
|
for (const [key, val] of props) {
|
|
@@ -5069,14 +4039,14 @@ const _export_sfc = (sfc, props) => {
|
|
|
5069
4039
|
}
|
|
5070
4040
|
return target;
|
|
5071
4041
|
};
|
|
5072
|
-
const CheckInPresenceCollection = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["__scopeId", "data-v-
|
|
4042
|
+
const CheckInPresenceCollection = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["__scopeId", "data-v-3ba48e60"]]);
|
|
5073
4043
|
const _hoisted_1$6 = { class: "grid gap-4 sm:grid-cols-2" };
|
|
5074
4044
|
const _sfc_main$h = /* @__PURE__ */ defineComponent({
|
|
5075
4045
|
__name: "CheckInSingle",
|
|
5076
4046
|
setup(__props) {
|
|
5077
4047
|
const {
|
|
5078
4048
|
fields,
|
|
5079
|
-
id
|
|
4049
|
+
id,
|
|
5080
4050
|
initialValues,
|
|
5081
4051
|
values,
|
|
5082
4052
|
isLoading,
|
|
@@ -5085,9 +4055,23 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
|
|
|
5085
4055
|
isMain,
|
|
5086
4056
|
isNew,
|
|
5087
4057
|
saveOne,
|
|
5088
|
-
discardChanges
|
|
4058
|
+
discardChanges,
|
|
4059
|
+
getOne
|
|
5089
4060
|
} = useSingle();
|
|
5090
|
-
useOperasional();
|
|
4061
|
+
const { staff } = useOperasional();
|
|
4062
|
+
onMounted(() => {
|
|
4063
|
+
var _a, _b, _c;
|
|
4064
|
+
console.log("idnya?", id.value);
|
|
4065
|
+
if (id.value === "new") {
|
|
4066
|
+
values.value.staffId = (_a = staff.value) == null ? void 0 : _a.id;
|
|
4067
|
+
values.value.staff = {
|
|
4068
|
+
id: (_b = staff.value) == null ? void 0 : _b.id,
|
|
4069
|
+
display: (_c = staff.value) == null ? void 0 : _c.display
|
|
4070
|
+
};
|
|
4071
|
+
values.value.checkInAt = new Date().toISOString();
|
|
4072
|
+
values.value.type = "checkpoint";
|
|
4073
|
+
}
|
|
4074
|
+
});
|
|
5091
4075
|
return (_ctx, _cache) => {
|
|
5092
4076
|
return openBlock(), createBlock(unref(NeonSingle), { class: "neu-checkIn-single" }, {
|
|
5093
4077
|
default: withCtx(() => [
|
|
@@ -5119,7 +4103,7 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
|
|
|
5119
4103
|
createVNode(unref(NeonField), mergeProps({
|
|
5120
4104
|
modelValue: unref(values).type,
|
|
5121
4105
|
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => unref(values).type = $event)
|
|
5122
|
-
}, unref(fields).type, { "is-disabled":
|
|
4106
|
+
}, unref(fields).type, { "is-disabled": "" }), null, 16, ["modelValue"]),
|
|
5123
4107
|
createVNode(unref(NeonField), mergeProps({
|
|
5124
4108
|
modelValue: unref(values).checkInAt,
|
|
5125
4109
|
"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => unref(values).checkInAt = $event)
|
|
@@ -5154,8 +4138,8 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
|
|
|
5154
4138
|
};
|
|
5155
4139
|
}
|
|
5156
4140
|
});
|
|
5157
|
-
const
|
|
5158
|
-
const CheckInSingle = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["__scopeId", "data-v-
|
|
4141
|
+
const CheckInSingle_vue_vue_type_style_index_0_scoped_2e2803fb_lang = "";
|
|
4142
|
+
const CheckInSingle = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["__scopeId", "data-v-2e2803fb"]]);
|
|
5159
4143
|
const _withScopeId$1 = (n) => (pushScopeId("data-v-d23b6de5"), n = n(), popScopeId(), n);
|
|
5160
4144
|
const _hoisted_1$5 = /* @__PURE__ */ _withScopeId$1(() => /* @__PURE__ */ createElementVNode(
|
|
5161
4145
|
"h4",
|
|
@@ -5977,7 +4961,7 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
5977
4961
|
setup(__props) {
|
|
5978
4962
|
const {
|
|
5979
4963
|
fields,
|
|
5980
|
-
id
|
|
4964
|
+
id,
|
|
5981
4965
|
initialValues,
|
|
5982
4966
|
values,
|
|
5983
4967
|
isLoading,
|
|
@@ -6141,7 +5125,7 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
6141
5125
|
setup(__props) {
|
|
6142
5126
|
const {
|
|
6143
5127
|
fields,
|
|
6144
|
-
id
|
|
5128
|
+
id,
|
|
6145
5129
|
initialValues,
|
|
6146
5130
|
values,
|
|
6147
5131
|
isNew,
|
|
@@ -6278,7 +5262,7 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
6278
5262
|
setup(__props) {
|
|
6279
5263
|
const {
|
|
6280
5264
|
fields,
|
|
6281
|
-
id
|
|
5265
|
+
id,
|
|
6282
5266
|
initialValues,
|
|
6283
5267
|
values,
|
|
6284
5268
|
isNew,
|
|
@@ -6417,7 +5401,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
6417
5401
|
setup(__props) {
|
|
6418
5402
|
const {
|
|
6419
5403
|
fields,
|
|
6420
|
-
id
|
|
5404
|
+
id,
|
|
6421
5405
|
initialValues,
|
|
6422
5406
|
values,
|
|
6423
5407
|
isNew,
|
|
@@ -6565,7 +5549,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
6565
5549
|
setup(__props) {
|
|
6566
5550
|
const {
|
|
6567
5551
|
fields,
|
|
6568
|
-
id
|
|
5552
|
+
id,
|
|
6569
5553
|
initialValues,
|
|
6570
5554
|
values,
|
|
6571
5555
|
isNew,
|
|
@@ -6641,7 +5625,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
6641
5625
|
const { client } = useClientHandle();
|
|
6642
5626
|
const {
|
|
6643
5627
|
fields,
|
|
6644
|
-
id
|
|
5628
|
+
id,
|
|
6645
5629
|
initialValues,
|
|
6646
5630
|
values,
|
|
6647
5631
|
isNew,
|
|
@@ -6769,7 +5753,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
6769
5753
|
setup(__props) {
|
|
6770
5754
|
const {
|
|
6771
5755
|
fields,
|
|
6772
|
-
id
|
|
5756
|
+
id,
|
|
6773
5757
|
initialValues,
|
|
6774
5758
|
values,
|
|
6775
5759
|
isNew,
|
|
@@ -6997,7 +5981,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
6997
5981
|
setup(__props) {
|
|
6998
5982
|
const {
|
|
6999
5983
|
fields,
|
|
7000
|
-
id
|
|
5984
|
+
id,
|
|
7001
5985
|
initialValues,
|
|
7002
5986
|
values,
|
|
7003
5987
|
isNew,
|