@ancon/wildcat-utils 1.43.0-timezone-refactor.8 → 1.43.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/_baseIsEqual-39cef2eb.mjs +530 -0
- package/_baseIsEqual-b3df9240.js +1 -0
- package/_baseIteratee-13e892b8.mjs +151 -0
- package/_baseIteratee-be26bb18.js +1 -0
- package/card/getScannedWalletReadingInfo.d.ts +2 -2
- package/card/getScannedWalletReadingInfo.js +1 -1
- package/card/getScannedWalletReadingInfo.mjs +6 -6
- package/checkout/getCheckoutOrderStatusTexts.js +1 -1
- package/checkout/getCheckoutOrderStatusTexts.mjs +5 -7
- package/checkout/getCheckoutPenguinLockersMetaData.js +1 -1
- package/checkout/getCheckoutPenguinLockersMetaData.mjs +2 -2
- package/checkout/index.js +1 -1
- package/checkout/index.mjs +47 -49
- package/checkout/isCheckoutItemsAreEqual.js +1 -1
- package/checkout/isCheckoutItemsAreEqual.mjs +13 -14
- package/currency/getFormattedCurrency.d.ts +15 -0
- package/currency/getFormattedCurrency.js +1 -1
- package/currency/getFormattedCurrency.mjs +25 -10
- package/index.d.ts +1 -2
- package/index.js +1 -1
- package/index.mjs +237 -255
- package/license/getLicenseUIState.d.ts +1 -1
- package/license/getLicenseUIState.js +1 -1
- package/license/getLicenseUIState.mjs +30 -11
- package/logger/index.js +1 -1
- package/logger/index.mjs +7 -8
- package/logger/pascalCaseFormatter.js +1 -1
- package/logger/pascalCaseFormatter.mjs +27 -21
- package/order/getCheckOrderItemsMappedByTicketItemStatus.js +1 -1
- package/order/getCheckOrderItemsMappedByTicketItemStatus.mjs +13 -15
- package/order/getCheckOrderMinimumStatusTicketItem.js +1 -1
- package/order/getCheckOrderMinimumStatusTicketItem.mjs +17 -19
- package/order/index.js +1 -1
- package/order/index.mjs +9 -11
- package/outlet/constants.d.ts +1 -0
- package/outlet/constants.js +1 -1
- package/outlet/constants.mjs +4 -3
- package/outlet/getExpressAvailableOrderFormats.js +1 -1
- package/outlet/getExpressAvailableOrderFormats.mjs +26 -27
- package/outlet/getExpressNextAvailabilityShiftTime.d.ts +2 -2
- package/outlet/getExpressNextAvailabilityShiftTime.js +1 -1
- package/outlet/getExpressNextAvailabilityShiftTime.mjs +18 -19
- package/outlet/getExpressServiceIntervalEnd.d.ts +2 -2
- package/outlet/getExpressServiceIntervalEnd.js +1 -1
- package/outlet/getExpressServiceIntervalEnd.mjs +9 -7
- package/outlet/getExpressServiceIntervalStart.d.ts +2 -2
- package/outlet/getExpressServiceIntervalStart.js +1 -1
- package/outlet/getExpressServiceIntervalStart.mjs +9 -7
- package/outlet/getListOutletOpeningHoursTable.d.ts +1 -1
- package/outlet/getListOutletOpeningHoursTable.js +1 -1
- package/outlet/getListOutletOpeningHoursTable.mjs +150 -135
- package/outlet/getMomentFromDateAndTimeString.js +1 -1
- package/outlet/getMomentFromDateAndTimeString.mjs +1 -1
- package/outlet/getOutletActiveOpeningInterval.d.ts +2 -2
- package/outlet/getOutletActiveOpeningInterval.js +1 -1
- package/outlet/getOutletActiveOpeningInterval.mjs +12 -15
- package/outlet/getOutletAvailabilityInfo.js +1 -1
- package/outlet/getOutletAvailabilityInfo.mjs +25 -23
- package/outlet/getOutletCurrentActiveOperatingHour.js +1 -1
- package/outlet/getOutletCurrentActiveOperatingHour.mjs +15 -16
- package/outlet/getOutletCurrentAvailabilityInfo.js +1 -1
- package/outlet/getOutletCurrentAvailabilityInfo.mjs +26 -27
- package/outlet/getOutletCurrentClosingTimeText.js +1 -1
- package/outlet/getOutletCurrentClosingTimeText.mjs +10 -14
- package/outlet/getOutletDeliveryFee.js +1 -1
- package/outlet/getOutletDeliveryFee.mjs +5 -5
- package/outlet/getOutletFormattedAddress.d.ts +1 -9
- package/outlet/getOutletFormattedAddress.js +1 -1
- package/outlet/getOutletFormattedAddress.mjs +4 -9
- package/outlet/getOutletNextOpeningTagInformation.js +1 -1
- package/outlet/getOutletNextOpeningTagInformation.mjs +7 -8
- package/outlet/getOutletNextOpeningTimeText.js +1 -1
- package/outlet/getOutletNextOpeningTimeText.mjs +8 -10
- package/outlet/getOutletNextReadyToOrderTime.js +1 -1
- package/outlet/getOutletNextReadyToOrderTime.mjs +29 -21
- package/outlet/getOutletNextServiceTimeOffset.d.ts +11 -0
- package/outlet/getOutletNextServiceTimeOffset.js +1 -0
- package/outlet/getOutletNextServiceTimeOffset.mjs +10 -0
- package/outlet/getOutletPickerTimesForDay.js +1 -1
- package/outlet/getOutletPickerTimesForDay.mjs +38 -36
- package/outlet/getOutletPickerTimesForWeek.js +1 -1
- package/outlet/getOutletPickerTimesForWeek.mjs +2 -2
- package/outlet/getOutletTagInformation.d.ts +1 -1
- package/outlet/getOutletTagInformation.js +1 -1
- package/outlet/getOutletTagInformation.mjs +70 -69
- package/outlet/getOutletTodayOpeningTimes.js +1 -1
- package/outlet/getOutletTodayOpeningTimes.mjs +39 -43
- package/outlet/getPartitionedOutletsList.js +1 -1
- package/outlet/getPartitionedOutletsList.mjs +4 -4
- package/outlet/getPickerIntervalsForDay.js +1 -1
- package/outlet/getPickerIntervalsForDay.mjs +12 -20
- package/outlet/getServiceIntervalEnd.d.ts +1 -1
- package/outlet/getServiceIntervalEnd.js +1 -1
- package/outlet/getServiceIntervalEnd.mjs +10 -12
- package/outlet/getServiceIntervalRange.d.ts +2 -1
- package/outlet/getServiceIntervalRange.js +1 -1
- package/outlet/getServiceIntervalRange.mjs +12 -8
- package/outlet/getServiceIntervalStart.d.ts +1 -1
- package/outlet/getServiceIntervalStart.js +1 -1
- package/outlet/getServiceIntervalStart.mjs +7 -6
- package/outlet/getServiceIntervalsForOrderFormat.d.ts +8 -7
- package/outlet/getStructuredOutletAddress.js +1 -1
- package/outlet/getStructuredOutletAddress.mjs +7 -7
- package/outlet/index.d.ts +2 -1
- package/outlet/index.js +1 -1
- package/outlet/index.mjs +68 -71
- package/outlet/searchNextOpeningMoment.d.ts +1 -1
- package/outlet/searchNextOpeningMoment.js +1 -1
- package/outlet/searchNextOpeningMoment.mjs +56 -49
- package/outlet/serviceDateTimesFromOpeningHours.d.ts +5 -3
- package/outlet/serviceDateTimesFromOpeningHours.js +1 -1
- package/outlet/serviceDateTimesFromOpeningHours.mjs +27 -342
- package/outlet/types.d.ts +2 -0
- package/package.json +16 -21
- package/quantity/getFormattedQuantity.d.ts +24 -0
- package/quantity/getFormattedQuantity.js +1 -0
- package/quantity/getFormattedQuantity.mjs +30 -0
- package/quantity/index.d.ts +2 -0
- package/quantity/index.js +1 -0
- package/quantity/index.mjs +4 -0
- package/time/getEndTimeSpanOfTimePeriod.js +1 -1
- package/time/getEndTimeSpanOfTimePeriod.mjs +9 -5
- package/toString-425512fc.js +1 -0
- package/{toString-3b91b335.mjs → toString-e631a957.mjs} +11 -12
- package/_baseIsEqual-12d01a44.mjs +0 -169
- package/_baseIsEqual-bcac9024.js +0 -1
- package/_baseIteratee-075c204c.js +0 -1
- package/_baseIteratee-4c4d0995.mjs +0 -97
- package/_baseSlice-4d543985.mjs +0 -10
- package/_baseSlice-e1b41ceb.js +0 -1
- package/_getTag-4e44633b.mjs +0 -382
- package/_getTag-b8923c48.js +0 -1
- package/date/createLocalTimezoneDate.d.ts +0 -8
- package/date/createLocalTimezoneDate.js +0 -1
- package/date/createLocalTimezoneDate.mjs +0 -8
- package/date/createLocalTimezoneMoment.d.ts +0 -9
- package/date/createLocalTimezoneMoment.js +0 -1
- package/date/createLocalTimezoneMoment.mjs +0 -8
- package/date/getFormattedUTCDateTime.d.ts +0 -10
- package/date/getFormattedUTCDateTime.js +0 -1
- package/date/getFormattedUTCDateTime.mjs +0 -8
- package/date/index.d.ts +0 -4
- package/date/index.js +0 -1
- package/date/index.mjs +0 -9
- package/identity-1bae7cf8.js +0 -1
- package/identity-6eafe87b.mjs +0 -64
- package/toString-9eae9442.js +0 -1
package/outlet/index.mjs
CHANGED
|
@@ -1,57 +1,52 @@
|
|
|
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
|
|
1
|
+
import { default as k } from "./getListOutletOpeningHoursTable.mjs";
|
|
2
|
+
import { default as E } from "./getOutletTagInformation.mjs";
|
|
3
|
+
import { default as h } from "./getOutletAvailabilityInfo.mjs";
|
|
4
|
+
import { default as M } from "./getOutletOfflineOrderFormats.mjs";
|
|
5
|
+
import { default as W } from "./getOutletAvailableOrderFormats.mjs";
|
|
6
|
+
import { default as q } from "./getOutletFormattedDistance.mjs";
|
|
7
|
+
import { default as z } from "./isOutletAcceptingPreOrders.mjs";
|
|
8
|
+
import { default as G } from "./getOutletDeliveryFee.mjs";
|
|
9
|
+
import { default as K } from "./getOutletTodayOpeningTimes.mjs";
|
|
10
|
+
import { default as U } from "./getOutletOrderFormats.mjs";
|
|
11
|
+
import { default as X } from "./serviceDateTimesFromOpeningHours.mjs";
|
|
12
|
+
import { default as Z } from "./getPickerIntervalsForDay.mjs";
|
|
13
|
+
import { default as $ } from "./getServiceIntervalRange.mjs";
|
|
14
|
+
import { default as et } from "./getServiceIntervalsForOrderFormat.mjs";
|
|
15
|
+
import { default as ot } from "./getOutletFormattedAddress.mjs";
|
|
16
|
+
import { default as it } from "./getPartitionedOutletsList.mjs";
|
|
17
|
+
import { default as lt } from "./getOutletPickerTimesForWeek.mjs";
|
|
18
|
+
import { default as pt } from "./getOutletPickerTimesForDay.mjs";
|
|
19
|
+
import { default as ut } from "./getOutletOrderPrepTime.mjs";
|
|
20
|
+
import { default as Ot } from "./getStructuredOutletAddress.mjs";
|
|
21
|
+
import { default as gt } from "./getOutletNextOpeningTimeText.mjs";
|
|
22
|
+
import { default as Tt } from "./getOutletCurrentClosingTimeText.mjs";
|
|
23
|
+
import { default as ct } from "./getOutletNextReadyToOrderTime.mjs";
|
|
24
|
+
import { default as At } from "./getOutletNextOpeningTagInformation.mjs";
|
|
25
|
+
import { default as bt } from "./getOutletCurrentAvailabilityInfo.mjs";
|
|
26
|
+
import { default as It } from "./getExpressAvailableOrderFormats.mjs";
|
|
27
|
+
import { default as Dt } from "./getExpressNextAvailabilityShiftTime.mjs";
|
|
28
|
+
import { default as kt } from "./getOrderFormatAOTipSettings.mjs";
|
|
29
|
+
import { default as Et } from "./isAOTippingEnabledForOrderFormat.mjs";
|
|
30
|
+
import { default as ht } from "./isMenuTreeHierarchyProductAvailable.mjs";
|
|
31
|
+
import { default as Mt } from "./getOutletMenuProductsSortCriteria.mjs";
|
|
32
|
+
import { default as Wt } from "./getOutletNextServiceTimeOffset.mjs";
|
|
32
33
|
import "moment";
|
|
33
34
|
import "@ancon/wildcat-types";
|
|
34
35
|
import "../shared/isWithinFlag.mjs";
|
|
35
36
|
import "../shared/generateId.mjs";
|
|
36
37
|
import "react";
|
|
37
|
-
import "../time/getTimeSpanParts.mjs";
|
|
38
|
-
import "../date/createLocalTimezoneMoment.mjs";
|
|
39
38
|
import "./constants.mjs";
|
|
40
39
|
import "./getOutletCurrentActiveOperatingHour.mjs";
|
|
41
40
|
import "./getMomentFromDateAndTimeString.mjs";
|
|
42
41
|
import "./searchNextOpeningMoment.mjs";
|
|
43
|
-
import "../_baseIteratee-
|
|
44
|
-
import "../
|
|
42
|
+
import "../_baseIteratee-13e892b8.mjs";
|
|
43
|
+
import "../_baseIsEqual-39cef2eb.mjs";
|
|
45
44
|
import "../isArray-0d9c7aaa.mjs";
|
|
46
|
-
import "../
|
|
47
|
-
import "../identity-6eafe87b.mjs";
|
|
48
|
-
import "../toString-3b91b335.mjs";
|
|
45
|
+
import "../toString-e631a957.mjs";
|
|
49
46
|
import "../noop-378485d5.mjs";
|
|
50
|
-
import "../_baseSlice-4d543985.mjs";
|
|
51
47
|
import "../shared/constants.mjs";
|
|
52
48
|
import "../time/toMinutes.mjs";
|
|
53
49
|
import "../time/getNextTenthMinute.mjs";
|
|
54
|
-
import "../string/truncate.mjs";
|
|
55
50
|
import "./types.mjs";
|
|
56
51
|
import "./getSettingsForOrderFormat.mjs";
|
|
57
52
|
import "./getServiceIntervalStart.mjs";
|
|
@@ -60,37 +55,39 @@ import "./generatePickerTimesForDay.mjs";
|
|
|
60
55
|
import "./getServiceIntervalEnd.mjs";
|
|
61
56
|
import "./hoursAndMinutesToMinutes.mjs";
|
|
62
57
|
import "./getExpressServiceIntervalStart.mjs";
|
|
58
|
+
import "../time/getTimeSpanParts.mjs";
|
|
63
59
|
import "./getExpressServiceIntervalEnd.mjs";
|
|
64
60
|
export {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
61
|
+
It as getExpressAvailableOrderFormats,
|
|
62
|
+
Dt as getExpressNextAvailabilityShiftTime,
|
|
63
|
+
k as getListOutletOpeningHoursTable,
|
|
64
|
+
kt as getOrderFormatAOTipSettings,
|
|
65
|
+
h as getOutletAvailabilityInfo,
|
|
66
|
+
W as getOutletAvailableOrderFormats,
|
|
67
|
+
bt as getOutletCurrentAvailabilityInfo,
|
|
68
|
+
Tt as getOutletCurrentClosingTimeText,
|
|
69
|
+
G as getOutletDeliveryFee,
|
|
70
|
+
ot as getOutletFormattedAddress,
|
|
71
|
+
q as getOutletFormattedDistance,
|
|
72
|
+
Mt as getOutletMenuProductsSortCriteria,
|
|
73
|
+
At as getOutletNextOpeningTagInformation,
|
|
74
|
+
gt as getOutletNextOpeningTimeText,
|
|
75
|
+
ct as getOutletNextReadyToOrderTime,
|
|
76
|
+
Wt as getOutletNextServiceTimeOffset,
|
|
77
|
+
M as getOutletOfflineOrderFormats,
|
|
78
|
+
U as getOutletOrderFormats,
|
|
79
|
+
ut as getOutletOrderPreparationTime,
|
|
80
|
+
pt as getOutletPickerTimesForDay,
|
|
81
|
+
lt as getOutletPickerTimesForWeek,
|
|
82
|
+
E as getOutletTagInformation,
|
|
83
|
+
K as getOutletTodayOpeningTimes,
|
|
84
|
+
it as getPartitionedOutletsList,
|
|
85
|
+
Z as getPickerIntervalsForDay,
|
|
86
|
+
$ as getServiceIntervalRange,
|
|
87
|
+
et as getServiceIntervalsForOrderFormat,
|
|
88
|
+
Ot as getStructuredOutletAddress,
|
|
89
|
+
Et as isAOTippingEnabledForOrderFormat,
|
|
90
|
+
ht as isMenuTreeHierarchyProductAvailable,
|
|
91
|
+
z as isOutletAcceptingPreOrders,
|
|
92
|
+
X as serviceDateTimesFromOpeningHours
|
|
96
93
|
};
|
|
@@ -10,5 +10,5 @@ import { OperatingHourFormattedMap } from './types';
|
|
|
10
10
|
*
|
|
11
11
|
* @return {Moment}
|
|
12
12
|
*/
|
|
13
|
-
declare function searchNextOpeningMoment(operatingHourMap: OperatingHourFormattedMap, relevantMoment: Moment): Moment | null;
|
|
13
|
+
declare function searchNextOpeningMoment(operatingHourMap: OperatingHourFormattedMap, relevantMoment: Moment, outletTimeZoneOffset?: string): Moment | null;
|
|
14
14
|
export default searchNextOpeningMoment;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const m=require("moment"),y=require("@ancon/wildcat-types"),
|
|
1
|
+
"use strict";const m=require("moment"),y=require("@ancon/wildcat-types"),c=require("./constants.js"),a=require("./getMomentFromDateAndTimeString.js");function O(i){const[e]=i.split(":").map(Number)??[];return e??0}function p(i,e,r="00:00:00"){const[t,o]=r.split(":"),n=i.clone().add(t,"hour").add(o,"minute").date()-e.date();return n!==0?i.subtract(n,"day"):i}function g(i){let e=null;const{intervals:r,exception:t}=i;if(t){const{state:o}=t;o||(e=t)}else{const o=r.sort((n,s)=>O(n.start)-O(s.start)),[u]=o;return u}return e}function h(i,e,r){var o,u;const t=[];if(e.exception){if(e.exception.state===y.IntervalState.Open){const n=a(i,e.exception.start);r.isBefore(n)&&t.push({interval:e.exception,moment:n})}}else for(let n=0;n<e.intervals.length;n+=1){const s=e.intervals[n],l=a(i,s.start);r.isBefore(l)&&t.push({interval:s,moment:l})}return t.length<2?((o=t[0])==null?void 0:o.interval)??null:((u=t.sort((n,s)=>n.moment-r-(s.moment-r))[0])==null?void 0:u.interval)??null}function x(i,e,r){let t=null;const o=m(e).format(c.OutletMapKeyFormatter),u=h(o,i[o],e);if(u&&(t=a(o,u.start)),!t)for(let n=1;n<c.OutletTimelineDayCount;n+=1){const s=m(e).add(n,"d"),l=s.format(c.OutletMapKeyFormatter),d=i[l],f=g(d);if(f){t=a(l,f.start),t=p(t,s,r);break}}return t}module.exports=x;
|
|
@@ -1,76 +1,83 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { IntervalState as
|
|
3
|
-
import c from "
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
return t !== 0 ? i.subtract(t, "day") : i;
|
|
1
|
+
import m from "moment";
|
|
2
|
+
import { IntervalState as d } from "@ancon/wildcat-types";
|
|
3
|
+
import { OutletMapKeyFormatter as c, OutletTimelineDayCount as y } from "./constants.mjs";
|
|
4
|
+
import u from "./getMomentFromDateAndTimeString.mjs";
|
|
5
|
+
function O(o) {
|
|
6
|
+
const [e] = o.split(":").map(Number) ?? [];
|
|
7
|
+
return e ?? 0;
|
|
9
8
|
}
|
|
10
|
-
function g(
|
|
9
|
+
function g(o, e, r = "00:00:00") {
|
|
10
|
+
const [t, i] = r.split(":"), n = o.clone().add(t, "hour").add(i, "minute").date() - e.date();
|
|
11
|
+
return n !== 0 ? o.subtract(n, "day") : o;
|
|
12
|
+
}
|
|
13
|
+
function h(o) {
|
|
11
14
|
let e = null;
|
|
12
|
-
const { intervals:
|
|
15
|
+
const { intervals: r, exception: t } = o;
|
|
13
16
|
if (t) {
|
|
14
|
-
const { state:
|
|
15
|
-
|
|
17
|
+
const { state: i } = t;
|
|
18
|
+
i || (e = t);
|
|
16
19
|
} else {
|
|
17
|
-
const
|
|
18
|
-
(
|
|
19
|
-
), [
|
|
20
|
-
return
|
|
20
|
+
const i = r.sort(
|
|
21
|
+
(n, s) => O(n.start) - O(s.start)
|
|
22
|
+
), [l] = i;
|
|
23
|
+
return l;
|
|
21
24
|
}
|
|
22
25
|
return e;
|
|
23
26
|
}
|
|
24
|
-
function
|
|
25
|
-
var
|
|
27
|
+
function x(o, e, r) {
|
|
28
|
+
var i, l;
|
|
26
29
|
const t = [];
|
|
27
30
|
if (e.exception) {
|
|
28
|
-
if (e.exception.state ===
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
e.exception.
|
|
31
|
+
if (e.exception.state === d.Open) {
|
|
32
|
+
const n = u(
|
|
33
|
+
o,
|
|
34
|
+
e.exception.start
|
|
32
35
|
);
|
|
33
|
-
|
|
36
|
+
r.isBefore(n) && t.push({
|
|
34
37
|
interval: e.exception,
|
|
35
|
-
moment:
|
|
38
|
+
moment: n
|
|
36
39
|
});
|
|
37
40
|
}
|
|
38
41
|
} else
|
|
39
|
-
for (let
|
|
40
|
-
const s = e.intervals[
|
|
41
|
-
|
|
42
|
-
s.
|
|
42
|
+
for (let n = 0; n < e.intervals.length; n += 1) {
|
|
43
|
+
const s = e.intervals[n], a = u(
|
|
44
|
+
o,
|
|
45
|
+
s.start
|
|
43
46
|
);
|
|
44
|
-
|
|
47
|
+
r.isBefore(a) && t.push({ interval: s, moment: a });
|
|
45
48
|
}
|
|
46
|
-
return t.length < 2 ? ((
|
|
49
|
+
return t.length < 2 ? ((i = t[0]) == null ? void 0 : i.interval) ?? null : ((l = t.sort(
|
|
47
50
|
// @ts-ignore TODO
|
|
48
|
-
(
|
|
49
|
-
)[0]) == null ? void 0 :
|
|
51
|
+
(n, s) => n.moment - r - (s.moment - r)
|
|
52
|
+
)[0]) == null ? void 0 : l.interval) ?? null;
|
|
50
53
|
}
|
|
51
|
-
function
|
|
52
|
-
let
|
|
53
|
-
const
|
|
54
|
-
|
|
55
|
-
i
|
|
54
|
+
function b(o, e, r) {
|
|
55
|
+
let t = null;
|
|
56
|
+
const i = m(e).format(c), l = x(
|
|
57
|
+
i,
|
|
58
|
+
o[i],
|
|
56
59
|
e
|
|
57
60
|
);
|
|
58
|
-
if (
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
)), !
|
|
62
|
-
for (let
|
|
63
|
-
const
|
|
64
|
-
if (
|
|
65
|
-
|
|
61
|
+
if (l && (t = u(
|
|
62
|
+
i,
|
|
63
|
+
l.start
|
|
64
|
+
)), !t)
|
|
65
|
+
for (let n = 1; n < y; n += 1) {
|
|
66
|
+
const s = m(e).add(n, "d"), a = s.format(c), p = o[a], f = h(p);
|
|
67
|
+
if (f) {
|
|
68
|
+
t = u(
|
|
69
|
+
a,
|
|
70
|
+
f.start
|
|
71
|
+
), t = g(
|
|
72
|
+
t,
|
|
66
73
|
s,
|
|
67
|
-
|
|
68
|
-
)
|
|
74
|
+
r
|
|
75
|
+
);
|
|
69
76
|
break;
|
|
70
77
|
}
|
|
71
78
|
}
|
|
72
|
-
return
|
|
79
|
+
return t;
|
|
73
80
|
}
|
|
74
81
|
export {
|
|
75
|
-
|
|
82
|
+
b as default
|
|
76
83
|
};
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ServiceDateTime } from '@ancon/wildcat-types';
|
|
2
2
|
export declare type OutletDetailsOpeningHour = {
|
|
3
|
-
type:
|
|
4
|
-
state:
|
|
3
|
+
type: 0;
|
|
4
|
+
state: 0;
|
|
5
5
|
orderFormat: 8;
|
|
6
6
|
dayOfWeek: 8;
|
|
7
|
+
unformattedPeriodFrom: '1900-01-01T00:00:00Z';
|
|
7
8
|
periodFrom: '1900-01-01T00:00:00';
|
|
9
|
+
unformattedPeriodTo: '2200-01-01T00:00:00Z';
|
|
8
10
|
periodTo: '2200-01-01T00:00:00';
|
|
9
11
|
from: '23:00:00';
|
|
10
12
|
duration: '06:00:00';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const
|
|
1
|
+
"use strict";const n=require("moment");function u({openingHours:s}){const e=s.reduce((o,r)=>{o[r.orderFormat]||(o[r.orderFormat]={orderFormats:r.orderFormat,intervals:[],isDefault:r.isDefault});const[t,a]=r.duration.split(":");return o[r.orderFormat].intervals.push({start:r.from,duration:r.duration,end:n(r.from,"HH:mm:ss").add(t,"hours").add(a,"minutes").format("HH:mm:ss"),fromDate:r.unformattedPeriodFrom,toDate:r.unformattedPeriodTo,type:r.type,position:r.position,state:r.state,dayOfWeek:r.dayOfWeek,isDefault:r.isDefault,reason:r.reason}),o},{});return Object.values(e)}module.exports=u;
|