@ancon/wildcat-utils 1.44.0-timezone-refactor.1 → 1.44.1
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/checkout/checkoutHasWallet.d.ts +3 -0
- package/checkout/getCheckoutRequestItemFromCheckoutItem.d.ts +2 -2
- package/checkout/getCheckoutRequestItemFromCheckoutItem.js +1 -1
- package/checkout/getCheckoutRequestItemFromCheckoutItem.mjs +26 -14
- package/checkout/getCheckoutWalletTopUpMetaData.d.ts +7 -0
- package/checkout/getCheckoutWalletTopUpMetaData.js +1 -0
- package/checkout/getCheckoutWalletTopUpMetaData.mjs +15 -0
- package/checkout/getWalletMetaFromCheckout.d.ts +3 -0
- package/checkout/index.d.ts +4 -1
- package/checkout/index.js +1 -1
- package/checkout/index.mjs +25 -19
- package/checkout/isWalletTopUpCheckout.d.ts +2 -0
- package/checkout/isWalletTopUpCheckout.js +1 -0
- package/checkout/isWalletTopUpCheckout.mjs +12 -0
- package/checkout/isWalletTopUpCheckoutItem.d.ts +2 -0
- package/checkout/isWalletTopUpCheckoutItem.js +1 -0
- package/checkout/isWalletTopUpCheckoutItem.mjs +9 -0
- package/courses/constants.js +1 -1
- package/courses/constants.mjs +1 -1
- package/date/convertToLocalTimezone.d.ts +8 -0
- package/date/convertToLocalTimezone.js +1 -0
- package/date/convertToLocalTimezone.mjs +12 -0
- package/date/convertToSpecificTimezone.d.ts +9 -0
- package/date/convertToSpecificTimezone.js +1 -0
- package/date/convertToSpecificTimezone.mjs +6 -0
- package/date/getTimezoneUtcOffsetDifference.d.ts +8 -0
- package/date/getTimezoneUtcOffsetDifference.js +1 -0
- package/date/getTimezoneUtcOffsetDifference.mjs +8 -0
- package/date/index.d.ts +5 -1
- package/date/index.js +1 -1
- package/date/index.mjs +14 -6
- package/date/isDSTShiftPresentInRange.d.ts +8 -0
- package/date/isDSTShiftPresentInRange.js +1 -0
- package/date/isDSTShiftPresentInRange.mjs +9 -0
- package/hangfire/createHangfirePoller.d.ts +8 -2
- package/hangfire/createHangfirePoller.js +1 -1
- package/hangfire/createHangfirePoller.mjs +72 -62
- package/hangfire/createMakeHangfireRequest.d.ts +10 -1
- package/hangfire/createMakeHangfireRequest.js +1 -1
- package/hangfire/createMakeHangfireRequest.mjs +16 -14
- package/index.js +1 -1
- package/index.mjs +216 -198
- package/outlet/getOutletCurrentActiveOperatingHour.js +1 -1
- package/outlet/getOutletCurrentActiveOperatingHour.mjs +26 -21
- package/outlet/getOutletCurrentAvailabilityInfo.js +1 -1
- package/outlet/getOutletCurrentAvailabilityInfo.mjs +18 -15
- package/outlet/getOutletCurrentClosingTimeText.js +1 -1
- package/outlet/getOutletCurrentClosingTimeText.mjs +15 -12
- package/outlet/getOutletNextOpeningTagInformation.js +1 -1
- package/outlet/getOutletNextOpeningTagInformation.mjs +13 -10
- package/outlet/getOutletNextOpeningTimeText.js +1 -1
- package/outlet/getOutletNextOpeningTimeText.mjs +12 -9
- package/outlet/getOutletNextReadyToOrderTime.js +1 -1
- package/outlet/getOutletNextReadyToOrderTime.mjs +38 -26
- package/outlet/getOutletPickerTimesForDay.js +1 -1
- package/outlet/getOutletPickerTimesForDay.mjs +101 -46
- package/outlet/getOutletPickerTimesForWeek.js +1 -1
- package/outlet/getOutletPickerTimesForWeek.mjs +13 -8
- package/outlet/getOutletTagInformation.js +1 -1
- package/outlet/getOutletTagInformation.mjs +64 -62
- package/outlet/getOutletTodayOpeningTimes.js +1 -1
- package/outlet/getOutletTodayOpeningTimes.mjs +21 -21
- package/outlet/getServiceIntervalEnd.js +1 -1
- package/outlet/getServiceIntervalEnd.mjs +11 -10
- package/outlet/getServiceIntervalStart.js +1 -1
- package/outlet/getServiceIntervalStart.mjs +7 -6
- package/outlet/getServiceIntervalTimeSpanMoment.d.ts +9 -0
- package/outlet/getServiceIntervalTimeSpanMoment.js +1 -0
- package/outlet/getServiceIntervalTimeSpanMoment.mjs +9 -0
- package/outlet/getTimezoneAdjustedServiceInterval.d.ts +14 -0
- package/outlet/getTimezoneAdjustedServiceInterval.js +1 -0
- package/outlet/getTimezoneAdjustedServiceInterval.mjs +26 -0
- package/outlet/index.js +1 -1
- package/outlet/index.mjs +69 -66
- package/outlet/searchNextOpeningMoment.js +1 -1
- package/outlet/searchNextOpeningMoment.mjs +61 -58
- package/outlet/types.d.ts +6 -0
- package/outlet/types.js +1 -1
- package/outlet/types.mjs +3 -2
- package/package.json +56 -11
- package/time/convertSecondsToTimeSpan.d.ts +9 -0
- package/time/convertSecondsToTimeSpan.js +1 -0
- package/time/convertSecondsToTimeSpan.mjs +12 -0
- package/time/convertTimeSpanToSeconds.d.ts +6 -0
- package/time/convertTimeSpanToSeconds.js +1 -0
- package/time/convertTimeSpanToSeconds.mjs +8 -0
- package/time/createTimeSpan.js +1 -1
- package/time/createTimeSpan.mjs +10 -5
- package/time/formatTimeSpan.js +1 -1
- package/time/formatTimeSpan.mjs +5 -4
- package/time/getDurationBetweenTimeSpans.d.ts +2 -2
- package/time/getDurationBetweenTimeSpans.js +1 -1
- package/time/getDurationBetweenTimeSpans.mjs +11 -9
- package/time/getEndTimeSpanOfTimePeriod.js +1 -1
- package/time/getEndTimeSpanOfTimePeriod.mjs +8 -6
- package/time/index.d.ts +3 -1
- package/time/index.js +1 -1
- package/time/index.mjs +16 -12
- package/outlet/getMomentFromDateAndTimeString.d.ts +0 -3
- package/outlet/getMomentFromDateAndTimeString.js +0 -1
- package/outlet/getMomentFromDateAndTimeString.mjs +0 -17
- package/outlet/getNextTenthMinute.d.ts +0 -2
- package/outlet/getNextTenthMinute.js +0 -1
- package/outlet/getNextTenthMinute.mjs +0 -7
|
@@ -1,12 +1,15 @@
|
|
|
1
|
-
import { IntervalType as
|
|
2
|
-
import
|
|
1
|
+
import { IntervalType as g } from "@ancon/wildcat-types";
|
|
2
|
+
import x from "moment";
|
|
3
3
|
import l from "../date/createLocalTimezoneMoment.mjs";
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
|
|
4
|
+
import { OutletMapKeyFormatter as d, OutletTimelineDayCount as k } from "./constants.mjs";
|
|
5
|
+
import y from "./getOutletCurrentActiveOperatingHour.mjs";
|
|
6
|
+
import D from "./searchNextOpeningMoment.mjs";
|
|
7
|
+
import M from "./getTimezoneAdjustedServiceInterval.mjs";
|
|
8
|
+
import "../time/getTimeSpanParts.mjs";
|
|
9
|
+
import "../date/getTimezoneUtcOffsetDifference.mjs";
|
|
10
|
+
import "../date/convertToSpecificTimezone.mjs";
|
|
11
|
+
import "./getServiceIntervalTimeSpanMoment.mjs";
|
|
12
|
+
const O = {
|
|
10
13
|
0: 127,
|
|
11
14
|
1: 1,
|
|
12
15
|
2: 2,
|
|
@@ -18,102 +21,101 @@ const x = {
|
|
|
18
21
|
// WEEKDAYS: 31,
|
|
19
22
|
// WEEKENDS: 96,
|
|
20
23
|
};
|
|
21
|
-
function
|
|
22
|
-
const
|
|
24
|
+
function I(n, e) {
|
|
25
|
+
const t = n.isSame(e, "d"), a = {
|
|
23
26
|
[e.format(d)]: {
|
|
24
27
|
intervals: [],
|
|
25
28
|
exception: null,
|
|
26
|
-
metadata: { dayOfWeek:
|
|
29
|
+
metadata: { dayOfWeek: O[e.isoWeekday()] }
|
|
27
30
|
}
|
|
28
31
|
};
|
|
29
|
-
for (let s =
|
|
30
|
-
const i =
|
|
32
|
+
for (let s = t ? 1 : 0; s < k; s += 1) {
|
|
33
|
+
const i = x(n).add(s, "d");
|
|
31
34
|
a[i.format(d)] = {
|
|
32
35
|
intervals: [],
|
|
33
36
|
exception: null,
|
|
34
|
-
metadata: { dayOfWeek:
|
|
37
|
+
metadata: { dayOfWeek: O[i.isoWeekday()] }
|
|
35
38
|
};
|
|
36
39
|
}
|
|
37
40
|
return a;
|
|
38
41
|
}
|
|
39
|
-
function
|
|
40
|
-
const
|
|
41
|
-
if (!
|
|
42
|
-
|
|
42
|
+
function S(n, e) {
|
|
43
|
+
const t = l(e.periodFrom), o = l(e.periodTo);
|
|
44
|
+
if (!t.isSame(
|
|
45
|
+
o,
|
|
43
46
|
"d"
|
|
44
47
|
))
|
|
45
48
|
Object.keys(n).forEach((s) => {
|
|
46
|
-
const i =
|
|
47
|
-
if (i.isSame(
|
|
48
|
-
const p = n[s],
|
|
49
|
-
e.position >
|
|
49
|
+
const i = x(s);
|
|
50
|
+
if (i.isSame(t, "d") || i.isSame(o, "d") || i.isBetween(t, o)) {
|
|
51
|
+
const p = n[s], c = p.exception ? p.exception.position : 0;
|
|
52
|
+
e.position > c && (p.exception = e);
|
|
50
53
|
}
|
|
51
54
|
});
|
|
52
55
|
else {
|
|
53
|
-
const s =
|
|
56
|
+
const s = t.format(d), i = n[s];
|
|
54
57
|
if (i) {
|
|
55
58
|
const u = i.exception ? i.exception.position : 0;
|
|
56
59
|
e.position > u && (i.exception = e);
|
|
57
60
|
}
|
|
58
61
|
}
|
|
59
62
|
}
|
|
60
|
-
function
|
|
61
|
-
Object.keys(n).forEach((
|
|
62
|
-
const
|
|
63
|
-
(a & s) === a &&
|
|
63
|
+
function T(n, e) {
|
|
64
|
+
Object.keys(n).forEach((t) => {
|
|
65
|
+
const o = n[t], { dayOfWeek: a } = o.metadata, { dayOfWeek: s } = e;
|
|
66
|
+
(a & s) === a && o.intervals.push(e);
|
|
64
67
|
});
|
|
65
68
|
}
|
|
66
|
-
function
|
|
67
|
-
const
|
|
69
|
+
function W(n, e, t) {
|
|
70
|
+
const o = I(e, t);
|
|
68
71
|
return n.forEach((a) => {
|
|
69
|
-
a.type ===
|
|
70
|
-
}),
|
|
72
|
+
a.type === g.Exception ? S(o, a) : T(o, a);
|
|
73
|
+
}), o;
|
|
71
74
|
}
|
|
72
|
-
function
|
|
73
|
-
const a =
|
|
75
|
+
function E(n, e, t, o) {
|
|
76
|
+
const a = W(
|
|
74
77
|
n,
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
), s =
|
|
78
|
+
t,
|
|
79
|
+
o
|
|
80
|
+
), s = o.format(d), i = y(
|
|
78
81
|
s,
|
|
79
82
|
a[s],
|
|
80
|
-
|
|
83
|
+
o
|
|
81
84
|
) !== null, u = e;
|
|
82
|
-
let p = null,
|
|
85
|
+
let p = null, c = null;
|
|
83
86
|
if (e) {
|
|
84
|
-
const
|
|
85
|
-
|
|
86
|
-
a[
|
|
87
|
-
|
|
87
|
+
const m = t.format(d), f = y(
|
|
88
|
+
m,
|
|
89
|
+
a[m],
|
|
90
|
+
t
|
|
88
91
|
);
|
|
89
|
-
if (
|
|
90
|
-
const
|
|
91
|
-
|
|
92
|
-
);
|
|
93
|
-
r = k(
|
|
92
|
+
if (f) {
|
|
93
|
+
const r = M(
|
|
94
|
+
m,
|
|
94
95
|
f,
|
|
95
|
-
|
|
96
|
-
)
|
|
96
|
+
t.utcOffset()
|
|
97
|
+
);
|
|
98
|
+
c = r.openingTime, p = r.closingTime;
|
|
97
99
|
}
|
|
98
100
|
} else
|
|
99
|
-
|
|
100
|
-
if (!e && !
|
|
101
|
-
const
|
|
102
|
-
(
|
|
103
|
-
), [
|
|
104
|
-
(
|
|
101
|
+
c = D(a, t);
|
|
102
|
+
if (!e && !c) {
|
|
103
|
+
const m = n.filter(
|
|
104
|
+
(r) => r.state && l(r.periodTo).isAfter(t)
|
|
105
|
+
), [f] = m.sort(
|
|
106
|
+
(r, v) => o.valueOf() - (l(r.periodTo).valueOf() - l(v.periodTo).valueOf())
|
|
105
107
|
);
|
|
106
|
-
if (
|
|
107
|
-
return
|
|
108
|
+
if (f)
|
|
109
|
+
return E(
|
|
108
110
|
n,
|
|
109
111
|
e,
|
|
110
|
-
l(
|
|
111
|
-
|
|
112
|
+
l(f.periodTo),
|
|
113
|
+
o
|
|
112
114
|
);
|
|
113
115
|
}
|
|
114
|
-
return { closingTime: p, openingTime:
|
|
116
|
+
return { closingTime: p, openingTime: c, openDuringSpecifiedTime: u, openNow: i };
|
|
115
117
|
}
|
|
116
118
|
export {
|
|
117
|
-
|
|
118
|
-
|
|
119
|
+
O as DaysOfWeekMap,
|
|
120
|
+
E as default
|
|
119
121
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const I=require("moment"),b=require("../_baseIteratee-075c204c.js"),g=require("../_baseIsEqual-bcac9024.js"),q=require("../_getTag-b8923c48.js"),T=require("../noop-7ea3b37b.js"),w=require("./getListOutletOpeningHoursTable.js");require("../identity-1bae7cf8.js");require("../isArray-640f9811.js");require("../toString-9eae9442.js");require("@ancon/wildcat-types");require("../shared/isWithinFlag.js");require("../shared/generateId.js");require("react");require("../time/getTimeSpanParts.js");require("../date/createLocalTimezoneMoment.js");function p(e,n,t,i){for(var
|
|
1
|
+
"use strict";const I=require("moment"),b=require("../_baseIteratee-075c204c.js"),g=require("../_baseIsEqual-bcac9024.js"),q=require("../_getTag-b8923c48.js"),T=require("../noop-7ea3b37b.js"),w=require("./getListOutletOpeningHoursTable.js");require("../identity-1bae7cf8.js");require("../isArray-640f9811.js");require("../toString-9eae9442.js");require("@ancon/wildcat-types");require("../shared/isWithinFlag.js");require("../shared/generateId.js");require("react");require("../time/getTimeSpanParts.js");require("../date/createLocalTimezoneMoment.js");function p(e,n,t,i){for(var u=e.length,r=t+(i?1:-1);i?r--:++r<u;)if(n(e[r],r,e))return r;return-1}function O(e){return e!==e}function S(e,n,t){for(var i=t-1,u=e.length;++i<u;)if(e[i]===n)return i;return-1}function x(e,n,t){return n===n?S(e,n,t):p(e,O,t)}function _(e,n){var t=e==null?0:e.length;return!!t&&x(e,n,0)>-1}function a(e,n,t){for(var i=-1,u=e==null?0:e.length;++i<u;)if(t(n,e[i]))return!0;return!1}var A=1/0,H=q.Set&&1/g.setToArray(new q.Set([,-0]))[1]==A?function(e){return new q.Set(e)}:T.noop;const N=H;var W=200;function k(e,n,t){var i=-1,u=_,r=e.length,c=!0,o=[],s=o;if(t)c=!1,u=a;else if(r>=W){var h=n?null:N(e);if(h)return g.setToArray(h);c=!1,u=g.cacheHas,s=new g.SetCache}else s=n?[]:o;e:for(;++i<r;){var l=e[i],f=n?n(l):l;if(l=t||l!==0?l:0,c&&f===f){for(var d=s.length;d--;)if(s[d]===f)continue e;n&&s.push(f),o.push(l)}else u(s,f,t)||(s!==o&&s.push(f),o.push(l))}return o}function E(e,n){return e&&e.length?k(e,b.baseIteratee(n)):[]}function $(e){const n=w(e),i=I().isoWeekday(),u=n.reduce((r,{openingHours:c})=>{var s;const o=(s=c.find(h=>h.isoWeekday===i))==null?void 0:s.open;return o&&r.push(...o),r},[]);return u?E(u,r=>`${r.start}-${r.end}`):null}module.exports=$;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import d from "moment";
|
|
2
2
|
import { b as I } from "../_baseIteratee-4c4d0995.mjs";
|
|
3
|
-
import { s as m, S as
|
|
3
|
+
import { s as m, S as b, c as w } from "../_baseIsEqual-12d01a44.mjs";
|
|
4
4
|
import { S as c } from "../_getTag-4e44633b.mjs";
|
|
5
|
-
import { n as
|
|
5
|
+
import { n as a } from "../noop-378485d5.mjs";
|
|
6
6
|
import O from "./getListOutletOpeningHoursTable.mjs";
|
|
7
7
|
import "../identity-6eafe87b.mjs";
|
|
8
8
|
import "../isArray-0d9c7aaa.mjs";
|
|
@@ -14,16 +14,16 @@ import "react";
|
|
|
14
14
|
import "../time/getTimeSpanParts.mjs";
|
|
15
15
|
import "../date/createLocalTimezoneMoment.mjs";
|
|
16
16
|
function S(n, e, t, i) {
|
|
17
|
-
for (var
|
|
18
|
-
if (e(n[
|
|
19
|
-
return
|
|
17
|
+
for (var o = n.length, r = t + (i ? 1 : -1); i ? r-- : ++r < o; )
|
|
18
|
+
if (e(n[r], r, n))
|
|
19
|
+
return r;
|
|
20
20
|
return -1;
|
|
21
21
|
}
|
|
22
22
|
function T(n) {
|
|
23
23
|
return n !== n;
|
|
24
24
|
}
|
|
25
25
|
function x(n, e, t) {
|
|
26
|
-
for (var i = t - 1,
|
|
26
|
+
for (var i = t - 1, o = n.length; ++i < o; )
|
|
27
27
|
if (n[i] === e)
|
|
28
28
|
return i;
|
|
29
29
|
return -1;
|
|
@@ -36,29 +36,29 @@ function H(n, e) {
|
|
|
36
36
|
return !!t && A(n, e, 0) > -1;
|
|
37
37
|
}
|
|
38
38
|
function N(n, e, t) {
|
|
39
|
-
for (var i = -1,
|
|
39
|
+
for (var i = -1, o = n == null ? 0 : n.length; ++i < o; )
|
|
40
40
|
if (t(e, n[i]))
|
|
41
41
|
return !0;
|
|
42
42
|
return !1;
|
|
43
43
|
}
|
|
44
44
|
var W = 1 / 0, k = c && 1 / m(new c([, -0]))[1] == W ? function(n) {
|
|
45
45
|
return new c(n);
|
|
46
|
-
} :
|
|
47
|
-
const
|
|
48
|
-
var
|
|
46
|
+
} : a;
|
|
47
|
+
const $ = k;
|
|
48
|
+
var q = 200;
|
|
49
49
|
function C(n, e, t) {
|
|
50
|
-
var i = -1,
|
|
50
|
+
var i = -1, o = H, r = n.length, h = !0, u = [], s = u;
|
|
51
51
|
if (t)
|
|
52
|
-
h = !1,
|
|
53
|
-
else if (
|
|
54
|
-
var p = e ? null :
|
|
52
|
+
h = !1, o = N;
|
|
53
|
+
else if (r >= q) {
|
|
54
|
+
var p = e ? null : $(n);
|
|
55
55
|
if (p)
|
|
56
56
|
return m(p);
|
|
57
|
-
h = !1,
|
|
57
|
+
h = !1, o = w, s = new b();
|
|
58
58
|
} else
|
|
59
59
|
s = e ? [] : u;
|
|
60
60
|
n:
|
|
61
|
-
for (; ++i <
|
|
61
|
+
for (; ++i < r; ) {
|
|
62
62
|
var f = n[i], l = e ? e(f) : f;
|
|
63
63
|
if (f = t || f !== 0 ? f : 0, h && l === l) {
|
|
64
64
|
for (var g = s.length; g--; )
|
|
@@ -66,7 +66,7 @@ function C(n, e, t) {
|
|
|
66
66
|
continue n;
|
|
67
67
|
e && s.push(l), u.push(f);
|
|
68
68
|
} else
|
|
69
|
-
|
|
69
|
+
o(s, l, t) || (s !== u && s.push(l), u.push(f));
|
|
70
70
|
}
|
|
71
71
|
return u;
|
|
72
72
|
}
|
|
@@ -74,17 +74,17 @@ function E(n, e) {
|
|
|
74
74
|
return n && n.length ? C(n, I(e)) : [];
|
|
75
75
|
}
|
|
76
76
|
function K(n) {
|
|
77
|
-
const e = O(n), i = d().isoWeekday(),
|
|
78
|
-
(
|
|
77
|
+
const e = O(n), i = d().isoWeekday(), o = e.reduce(
|
|
78
|
+
(r, { openingHours: h }) => {
|
|
79
79
|
var s;
|
|
80
80
|
const u = (s = h.find(
|
|
81
81
|
(p) => p.isoWeekday === i
|
|
82
82
|
)) == null ? void 0 : s.open;
|
|
83
|
-
return u &&
|
|
83
|
+
return u && r.push(...u), r;
|
|
84
84
|
},
|
|
85
85
|
[]
|
|
86
86
|
);
|
|
87
|
-
return
|
|
87
|
+
return o ? E(o, (r) => `${r.start}-${r.end}`) : null;
|
|
88
88
|
}
|
|
89
89
|
export {
|
|
90
90
|
K as default
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const
|
|
1
|
+
"use strict";const m=require("moment"),r=require("../time/getTimeSpanParts.js"),a=require("./hoursAndMinutesToMinutes.js"),d=require("./getServiceIntervalTimeSpanMoment.js");function p(o,n,i="00:00:00"){const s=m(),t=r(i),u=r(n.duration),e=d(o,n.from);e.add(u);const c=a(t.hours,t.minutes);return e.diff(s,"minute")<c&&e.subtract(t),e}module.exports=p;
|
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import
|
|
1
|
+
import a from "moment";
|
|
2
2
|
import o from "../time/getTimeSpanParts.mjs";
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
t.
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
3
|
+
import p from "./hoursAndMinutesToMinutes.mjs";
|
|
4
|
+
import f from "./getServiceIntervalTimeSpanMoment.mjs";
|
|
5
|
+
function S(r, n, i = "00:00:00") {
|
|
6
|
+
const m = a(), e = o(i), s = o(n.duration), t = f(r, n.from);
|
|
7
|
+
t.add(s);
|
|
8
|
+
const u = p(
|
|
9
|
+
e.hours,
|
|
10
|
+
e.minutes
|
|
10
11
|
);
|
|
11
|
-
return t.diff(m, "minute") <
|
|
12
|
+
return t.diff(m, "minute") < u && t.subtract(e), t;
|
|
12
13
|
}
|
|
13
14
|
export {
|
|
14
|
-
|
|
15
|
+
S as default
|
|
15
16
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const
|
|
1
|
+
"use strict";const o=require("../time/getTimeSpanParts.js"),s=require("../time/getNextTenthMinute.js"),u=require("./getServiceIntervalTimeSpanMoment.js");require("moment");function a(t,r,n="00:00:00"){const i=o(n),e=u(t,r.from);return e.add(i),e.minute(s(e)),e}module.exports=a;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import o from "../time/getTimeSpanParts.mjs";
|
|
2
|
+
import i from "../time/getNextTenthMinute.mjs";
|
|
3
|
+
import a from "./getServiceIntervalTimeSpanMoment.mjs";
|
|
3
4
|
import "moment";
|
|
4
|
-
function
|
|
5
|
-
const
|
|
6
|
-
return t.add(
|
|
5
|
+
function u(e, r, m = "00:00:00") {
|
|
6
|
+
const n = o(m), t = a(e, r.from);
|
|
7
|
+
return t.add(n), t.minute(i(t)), t;
|
|
7
8
|
}
|
|
8
9
|
export {
|
|
9
|
-
|
|
10
|
+
u as default
|
|
10
11
|
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Moment, MomentInput } from 'moment';
|
|
2
|
+
/**
|
|
3
|
+
* This generates the Moment for the given opening hour time span and the specified date.
|
|
4
|
+
*
|
|
5
|
+
* @param date - Specific date.
|
|
6
|
+
* @param timeSpan - Service interval time span.
|
|
7
|
+
* @returns The generated Moment object
|
|
8
|
+
*/
|
|
9
|
+
export default function getServiceIntervalTimeSpanMoment(date: MomentInput, timeSpan: string): Moment;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const o=require("moment"),m=require("../time/getTimeSpanParts.js");function i(t,n){const e=m(n);return o(t).hour(e.hours).minute(e.minutes).second(0).millisecond(0)}module.exports=i;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import moment from 'moment';
|
|
2
|
+
import { ServiceDateTimeInterval } from '@ancon/wildcat-types';
|
|
3
|
+
/**
|
|
4
|
+
* This function adjusts the service interval opening and closing time to the specified timezone,
|
|
5
|
+
* if opening and closing time are in different timezone offsets.
|
|
6
|
+
* @param date The date of the service interval
|
|
7
|
+
* @param interval The service interval object
|
|
8
|
+
* @param timezoneOffset The specific timezone offset. If not provided, the local timezone offset will be used.
|
|
9
|
+
* @returns The adjusted service interval opening and closing time
|
|
10
|
+
*/
|
|
11
|
+
export default function getTimezoneAdjustedServiceInterval(date: string, interval: ServiceDateTimeInterval, timezoneOffset?: number): {
|
|
12
|
+
openingTime: moment.Moment;
|
|
13
|
+
closingTime: moment.Moment;
|
|
14
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const c=require("moment"),f=require("../time/getTimeSpanParts.js"),s=require("../date/getTimezoneUtcOffsetDifference.js"),a=require("../date/convertToSpecificTimezone.js"),m=require("./getServiceIntervalTimeSpanMoment.js");function u(r,i,o){const n=f(i.duration);let e=m(r,i.from),t=e.clone().add(n);return s(e,t)&&(e=a(e,o??c().utcOffset(),!0),t=e.clone().add(n)),{openingTime:e,closingTime:t}}module.exports=u;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import f from "moment";
|
|
2
|
+
import m from "../time/getTimeSpanParts.mjs";
|
|
3
|
+
import c from "../date/getTimezoneUtcOffsetDifference.mjs";
|
|
4
|
+
import a from "../date/convertToSpecificTimezone.mjs";
|
|
5
|
+
import l from "./getServiceIntervalTimeSpanMoment.mjs";
|
|
6
|
+
function v(o, i, r) {
|
|
7
|
+
const n = m(i.duration);
|
|
8
|
+
let e = l(
|
|
9
|
+
o,
|
|
10
|
+
i.from
|
|
11
|
+
), t = e.clone().add(n);
|
|
12
|
+
return c(
|
|
13
|
+
e,
|
|
14
|
+
t
|
|
15
|
+
) && (e = a(
|
|
16
|
+
e,
|
|
17
|
+
r ?? f().utcOffset(),
|
|
18
|
+
!0
|
|
19
|
+
), t = e.clone().add(n)), {
|
|
20
|
+
openingTime: e,
|
|
21
|
+
closingTime: t
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
export {
|
|
25
|
+
v as default
|
|
26
|
+
};
|
package/outlet/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./getListOutletOpeningHoursTable.js"),t=require("./getOutletTagInformation.js"),r=require("./getOutletAvailabilityInfo.js"),i=require("./getOutletOfflineOrderFormats.js"),u=require("./getOutletAvailableOrderFormats.js"),o=require("./getOutletFormattedDistance.js"),l=require("./isOutletAcceptingPreOrders.js"),s=require("./getOutletDeliveryFee.js"),n=require("./getOutletTodayOpeningTimes.js"),a=require("./getOutletOrderFormats.js"),O=require("./serviceDateTimesFromOpeningHours.js"),g=require("./getPickerIntervalsForDay.js"),q=require("./getServiceIntervalRange.js"),c=require("./getServiceIntervalsForOrderFormat.js"),d=require("./getOutletFormattedAddress.js"),m=require("./getPartitionedOutletsList.js"),T=require("./getOutletPickerTimesForWeek.js"),F=require("./getOutletPickerTimesForDay.js"),_=require("./getOutletOrderPrepTime.js"),v=require("./getStructuredOutletAddress.js"),p=require("./getOutletNextOpeningTimeText.js"),f=require("./getOutletCurrentClosingTimeText.js"),A=require("./getOutletNextReadyToOrderTime.js"),y=require("./getOutletNextOpeningTagInformation.js"),b=require("./getOutletCurrentAvailabilityInfo.js"),x=require("./getExpressAvailableOrderFormats.js"),P=require("./getExpressNextAvailabilityShiftTime.js"),S=require("./getOrderFormatAOTipSettings.js"),I=require("./isAOTippingEnabledForOrderFormat.js"),D=require("./isMenuTreeHierarchyProductAvailable.js"),N=require("./getOutletMenuProductsSortCriteria.js"),k=require("./getOutletNextServiceTimeOffset.js");require("moment");require("@ancon/wildcat-types");require("../shared/isWithinFlag.js");require("../shared/generateId.js");require("react");require("../time/getTimeSpanParts.js");require("../date/createLocalTimezoneMoment.js");require("./constants.js");require("./getOutletCurrentActiveOperatingHour.js");require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./getListOutletOpeningHoursTable.js"),t=require("./getOutletTagInformation.js"),r=require("./getOutletAvailabilityInfo.js"),i=require("./getOutletOfflineOrderFormats.js"),u=require("./getOutletAvailableOrderFormats.js"),o=require("./getOutletFormattedDistance.js"),l=require("./isOutletAcceptingPreOrders.js"),s=require("./getOutletDeliveryFee.js"),n=require("./getOutletTodayOpeningTimes.js"),a=require("./getOutletOrderFormats.js"),O=require("./serviceDateTimesFromOpeningHours.js"),g=require("./getPickerIntervalsForDay.js"),q=require("./getServiceIntervalRange.js"),c=require("./getServiceIntervalsForOrderFormat.js"),d=require("./getOutletFormattedAddress.js"),m=require("./getPartitionedOutletsList.js"),T=require("./getOutletPickerTimesForWeek.js"),F=require("./getOutletPickerTimesForDay.js"),_=require("./getOutletOrderPrepTime.js"),v=require("./getStructuredOutletAddress.js"),p=require("./getOutletNextOpeningTimeText.js"),f=require("./getOutletCurrentClosingTimeText.js"),A=require("./getOutletNextReadyToOrderTime.js"),y=require("./getOutletNextOpeningTagInformation.js"),b=require("./getOutletCurrentAvailabilityInfo.js"),x=require("./getExpressAvailableOrderFormats.js"),P=require("./getExpressNextAvailabilityShiftTime.js"),S=require("./getOrderFormatAOTipSettings.js"),I=require("./isAOTippingEnabledForOrderFormat.js"),D=require("./isMenuTreeHierarchyProductAvailable.js"),N=require("./getOutletMenuProductsSortCriteria.js"),k=require("./getOutletNextServiceTimeOffset.js");require("moment");require("@ancon/wildcat-types");require("../shared/isWithinFlag.js");require("../shared/generateId.js");require("react");require("../time/getTimeSpanParts.js");require("../date/createLocalTimezoneMoment.js");require("./constants.js");require("./getOutletCurrentActiveOperatingHour.js");require("./getTimezoneAdjustedServiceInterval.js");require("../date/getTimezoneUtcOffsetDifference.js");require("../date/convertToSpecificTimezone.js");require("./getServiceIntervalTimeSpanMoment.js");require("./searchNextOpeningMoment.js");require("../_baseIteratee-075c204c.js");require("../_getTag-b8923c48.js");require("../isArray-640f9811.js");require("../_baseIsEqual-bcac9024.js");require("../identity-1bae7cf8.js");require("../toString-9eae9442.js");require("../noop-7ea3b37b.js");require("../_baseSlice-e1b41ceb.js");require("../shared/constants.js");require("../time/toMinutes.js");require("../time/getNextTenthMinute.js");require("../string/truncate.js");require("./types.js");require("../date/isDSTShiftPresentInRange.js");require("./getSettingsForOrderFormat.js");require("./getServiceIntervalStart.js");require("./generatePickerTimesForDay.js");require("./getServiceIntervalEnd.js");require("./hoursAndMinutesToMinutes.js");require("./getExpressServiceIntervalStart.js");require("./getExpressServiceIntervalEnd.js");exports.getListOutletOpeningHoursTable=e;exports.getOutletTagInformation=t.default;exports.getOutletAvailabilityInfo=r.default;exports.getOutletOfflineOrderFormats=i;exports.getOutletAvailableOrderFormats=u;exports.getOutletFormattedDistance=o;exports.isOutletAcceptingPreOrders=l;exports.getOutletDeliveryFee=s;exports.getOutletTodayOpeningTimes=n;exports.getOutletOrderFormats=a;exports.serviceDateTimesFromOpeningHours=O;exports.getPickerIntervalsForDay=g;exports.getServiceIntervalRange=q;exports.getServiceIntervalsForOrderFormat=c;exports.getOutletFormattedAddress=d;exports.getPartitionedOutletsList=m;exports.getOutletPickerTimesForWeek=T;exports.getOutletPickerTimesForDay=F;exports.getOutletOrderPreparationTime=_;exports.getStructuredOutletAddress=v;exports.getOutletNextOpeningTimeText=p;exports.getOutletCurrentClosingTimeText=f;exports.getOutletNextReadyToOrderTime=A;exports.getOutletNextOpeningTagInformation=y;exports.getOutletCurrentAvailabilityInfo=b;exports.getExpressAvailableOrderFormats=x;exports.getExpressNextAvailabilityShiftTime=P;exports.getOrderFormatAOTipSettings=S.default;exports.isAOTippingEnabledForOrderFormat=I;exports.isMenuTreeHierarchyProductAvailable=D;exports.getOutletMenuProductsSortCriteria=N;exports.getOutletNextServiceTimeOffset=k;
|
package/outlet/index.mjs
CHANGED
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
import { default as
|
|
2
|
-
import { default as
|
|
3
|
-
import { default as
|
|
4
|
-
import { default as
|
|
5
|
-
import { default as
|
|
6
|
-
import { default as
|
|
7
|
-
import { default as
|
|
8
|
-
import { default as
|
|
9
|
-
import { default as
|
|
10
|
-
import { default as
|
|
11
|
-
import { default as
|
|
12
|
-
import { default as
|
|
13
|
-
import { default as
|
|
14
|
-
import { default as
|
|
15
|
-
import { default as
|
|
16
|
-
import { default as
|
|
17
|
-
import { default as
|
|
18
|
-
import { default as
|
|
19
|
-
import { default as
|
|
20
|
-
import { default as
|
|
21
|
-
import { default as
|
|
22
|
-
import { default as
|
|
23
|
-
import { default as
|
|
24
|
-
import { default as
|
|
25
|
-
import { default as
|
|
26
|
-
import { default as
|
|
27
|
-
import { default as
|
|
28
|
-
import { default as
|
|
29
|
-
import { default as
|
|
30
|
-
import { default as
|
|
31
|
-
import { default as
|
|
32
|
-
import { default as
|
|
1
|
+
import { default as W } from "./getListOutletOpeningHoursTable.mjs";
|
|
2
|
+
import { default as q } from "./getOutletTagInformation.mjs";
|
|
3
|
+
import { default as z } from "./getOutletAvailabilityInfo.mjs";
|
|
4
|
+
import { default as G } from "./getOutletOfflineOrderFormats.mjs";
|
|
5
|
+
import { default as K } from "./getOutletAvailableOrderFormats.mjs";
|
|
6
|
+
import { default as U } from "./getOutletFormattedDistance.mjs";
|
|
7
|
+
import { default as X } from "./isOutletAcceptingPreOrders.mjs";
|
|
8
|
+
import { default as Z } from "./getOutletDeliveryFee.mjs";
|
|
9
|
+
import { default as $ } from "./getOutletTodayOpeningTimes.mjs";
|
|
10
|
+
import { default as et } from "./getOutletOrderFormats.mjs";
|
|
11
|
+
import { default as ot } from "./serviceDateTimesFromOpeningHours.mjs";
|
|
12
|
+
import { default as it } from "./getPickerIntervalsForDay.mjs";
|
|
13
|
+
import { default as pt } from "./getServiceIntervalRange.mjs";
|
|
14
|
+
import { default as ft } from "./getServiceIntervalsForOrderFormat.mjs";
|
|
15
|
+
import { default as ut } from "./getOutletFormattedAddress.mjs";
|
|
16
|
+
import { default as Ot } from "./getPartitionedOutletsList.mjs";
|
|
17
|
+
import { default as gt } from "./getOutletPickerTimesForWeek.mjs";
|
|
18
|
+
import { default as Tt } from "./getOutletPickerTimesForDay.mjs";
|
|
19
|
+
import { default as ct } from "./getOutletOrderPrepTime.mjs";
|
|
20
|
+
import { default as At } from "./getStructuredOutletAddress.mjs";
|
|
21
|
+
import { default as bt } from "./getOutletNextOpeningTimeText.mjs";
|
|
22
|
+
import { default as It } from "./getOutletCurrentClosingTimeText.mjs";
|
|
23
|
+
import { default as Dt } from "./getOutletNextReadyToOrderTime.mjs";
|
|
24
|
+
import { default as kt } from "./getOutletNextOpeningTagInformation.mjs";
|
|
25
|
+
import { default as Et } from "./getOutletCurrentAvailabilityInfo.mjs";
|
|
26
|
+
import { default as ht } from "./getExpressAvailableOrderFormats.mjs";
|
|
27
|
+
import { default as Mt } from "./getExpressNextAvailabilityShiftTime.mjs";
|
|
28
|
+
import { default as Wt } from "./getOrderFormatAOTipSettings.mjs";
|
|
29
|
+
import { default as qt } from "./isAOTippingEnabledForOrderFormat.mjs";
|
|
30
|
+
import { default as zt } from "./isMenuTreeHierarchyProductAvailable.mjs";
|
|
31
|
+
import { default as Gt } from "./getOutletMenuProductsSortCriteria.mjs";
|
|
32
|
+
import { default as Kt } from "./getOutletNextServiceTimeOffset.mjs";
|
|
33
33
|
import "moment";
|
|
34
34
|
import "@ancon/wildcat-types";
|
|
35
35
|
import "../shared/isWithinFlag.mjs";
|
|
@@ -39,7 +39,10 @@ import "../time/getTimeSpanParts.mjs";
|
|
|
39
39
|
import "../date/createLocalTimezoneMoment.mjs";
|
|
40
40
|
import "./constants.mjs";
|
|
41
41
|
import "./getOutletCurrentActiveOperatingHour.mjs";
|
|
42
|
-
import "./
|
|
42
|
+
import "./getTimezoneAdjustedServiceInterval.mjs";
|
|
43
|
+
import "../date/getTimezoneUtcOffsetDifference.mjs";
|
|
44
|
+
import "../date/convertToSpecificTimezone.mjs";
|
|
45
|
+
import "./getServiceIntervalTimeSpanMoment.mjs";
|
|
43
46
|
import "./searchNextOpeningMoment.mjs";
|
|
44
47
|
import "../_baseIteratee-4c4d0995.mjs";
|
|
45
48
|
import "../_getTag-4e44633b.mjs";
|
|
@@ -54,45 +57,45 @@ import "../time/toMinutes.mjs";
|
|
|
54
57
|
import "../time/getNextTenthMinute.mjs";
|
|
55
58
|
import "../string/truncate.mjs";
|
|
56
59
|
import "./types.mjs";
|
|
60
|
+
import "../date/isDSTShiftPresentInRange.mjs";
|
|
57
61
|
import "./getSettingsForOrderFormat.mjs";
|
|
58
62
|
import "./getServiceIntervalStart.mjs";
|
|
59
|
-
import "./getNextTenthMinute.mjs";
|
|
60
63
|
import "./generatePickerTimesForDay.mjs";
|
|
61
64
|
import "./getServiceIntervalEnd.mjs";
|
|
62
65
|
import "./hoursAndMinutesToMinutes.mjs";
|
|
63
66
|
import "./getExpressServiceIntervalStart.mjs";
|
|
64
67
|
import "./getExpressServiceIntervalEnd.mjs";
|
|
65
68
|
export {
|
|
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
|
-
|
|
69
|
+
ht as getExpressAvailableOrderFormats,
|
|
70
|
+
Mt as getExpressNextAvailabilityShiftTime,
|
|
71
|
+
W as getListOutletOpeningHoursTable,
|
|
72
|
+
Wt as getOrderFormatAOTipSettings,
|
|
73
|
+
z as getOutletAvailabilityInfo,
|
|
74
|
+
K as getOutletAvailableOrderFormats,
|
|
75
|
+
Et as getOutletCurrentAvailabilityInfo,
|
|
76
|
+
It as getOutletCurrentClosingTimeText,
|
|
77
|
+
Z as getOutletDeliveryFee,
|
|
78
|
+
ut as getOutletFormattedAddress,
|
|
79
|
+
U as getOutletFormattedDistance,
|
|
80
|
+
Gt as getOutletMenuProductsSortCriteria,
|
|
81
|
+
kt as getOutletNextOpeningTagInformation,
|
|
82
|
+
bt as getOutletNextOpeningTimeText,
|
|
83
|
+
Dt as getOutletNextReadyToOrderTime,
|
|
84
|
+
Kt as getOutletNextServiceTimeOffset,
|
|
85
|
+
G as getOutletOfflineOrderFormats,
|
|
86
|
+
et as getOutletOrderFormats,
|
|
87
|
+
ct as getOutletOrderPreparationTime,
|
|
88
|
+
Tt as getOutletPickerTimesForDay,
|
|
89
|
+
gt as getOutletPickerTimesForWeek,
|
|
90
|
+
q as getOutletTagInformation,
|
|
91
|
+
$ as getOutletTodayOpeningTimes,
|
|
92
|
+
Ot as getPartitionedOutletsList,
|
|
93
|
+
it as getPickerIntervalsForDay,
|
|
94
|
+
pt as getServiceIntervalRange,
|
|
95
|
+
ft as getServiceIntervalsForOrderFormat,
|
|
96
|
+
At as getStructuredOutletAddress,
|
|
97
|
+
qt as isAOTippingEnabledForOrderFormat,
|
|
98
|
+
zt as isMenuTreeHierarchyProductAvailable,
|
|
99
|
+
X as isOutletAcceptingPreOrders,
|
|
100
|
+
ot as serviceDateTimesFromOpeningHours
|
|
98
101
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const m=require("moment"),
|
|
1
|
+
"use strict";const m=require("moment"),O=require("@ancon/wildcat-types"),d=require("../time/getTimeSpanParts.js"),f=require("./constants.js"),c=require("./getTimezoneAdjustedServiceInterval.js");require("../date/getTimezoneUtcOffsetDifference.js");require("../date/convertToSpecificTimezone.js");require("./getServiceIntervalTimeSpanMoment.js");function p(u){let e=null;const{intervals:t,exception:n}=u;if(n){const{state:s}=n;s||(e=n)}else{const s=t.sort((o,i)=>d(o.from).hours-d(i.from).hours),[r]=s;return r}return e}function g(u,e,t){var s,r;const n=[];if(e.exception){if(e.exception.state===O.IntervalState.Opened){const i=c(u,e.exception,t.utcOffset()).openingTime;t.isBefore(i)&&n.push({interval:e.exception,moment:i})}}else for(let o=0;o<e.intervals.length;o+=1){const i=e.intervals[o],l=c(u,i,t.utcOffset()).openingTime;t.isBefore(l)&&n.push({interval:i,moment:l})}return n.length<2?((s=n[0])==null?void 0:s.interval)??null:((r=n.sort((o,i)=>o.moment-t-(i.moment-t))[0])==null?void 0:r.interval)??null}function v(u,e){let t=null;const n=m(e).format(f.OutletMapKeyFormatter),s=g(n,u[n],e);if(s&&(t=c(n,s,e.utcOffset()).openingTime),!t)for(let r=1;r<f.OutletTimelineDayCount;r+=1){const o=m(e).add(r,"d"),i=o.format(f.OutletMapKeyFormatter),a=u[i],l=p(a);if(l){t=c(i,l,o.utcOffset()).openingTime;break}}return t}module.exports=v;
|