turf-common 1.4.2-beta.25 → 1.4.2-beta.26
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.
|
@@ -46,13 +46,18 @@ export declare class TurfAvailability implements ITurfAvailability {
|
|
|
46
46
|
getTotalTime(): number;
|
|
47
47
|
getCode(): string;
|
|
48
48
|
getEventCode(): string;
|
|
49
|
-
parseEventCode(eventCode: string): {
|
|
49
|
+
static parseEventCode(eventCode: string): {
|
|
50
50
|
fromDateCode: string;
|
|
51
51
|
toDateCode: string;
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
52
|
+
data: {
|
|
53
|
+
fromDateCode: string;
|
|
54
|
+
toDateCode: string;
|
|
55
|
+
fromTimeCode: string;
|
|
56
|
+
toTimeCode: string;
|
|
57
|
+
weekDay: number;
|
|
58
|
+
}[];
|
|
59
|
+
pitchIds: string[];
|
|
60
|
+
};
|
|
56
61
|
parse(): void;
|
|
57
62
|
static parse(eventCode: string): {
|
|
58
63
|
pitchCodes: string[];
|
|
@@ -193,7 +193,7 @@ var TurfAvailability = /** @class */ (function () {
|
|
|
193
193
|
}
|
|
194
194
|
return "";
|
|
195
195
|
};
|
|
196
|
-
TurfAvailability.
|
|
196
|
+
TurfAvailability.parseEventCode = function (eventCode) {
|
|
197
197
|
var eventCodes = eventCode.split("#");
|
|
198
198
|
var dateCodeRange = eventCodes[1];
|
|
199
199
|
var weekdayTimeSlots = eventCodes[2].split(",");
|
|
@@ -213,6 +213,7 @@ var TurfAvailability = /** @class */ (function () {
|
|
|
213
213
|
dateCodes.push.apply(dateCodes, booking_code_model_1.BookingCode.getDateCodesByWeek(Number(dateCodeRange.slice(0, 6)), Number(dateCodeRange.slice(7, 13)), weekday));
|
|
214
214
|
}
|
|
215
215
|
var data = [];
|
|
216
|
+
dateCodes.sort();
|
|
216
217
|
for (var _b = 0, dateCodes_1 = dateCodes; _b < dateCodes_1.length; _b++) {
|
|
217
218
|
var dateCode = dateCodes_1[_b];
|
|
218
219
|
var dateCodeWeekday = booking_code_model_1.BookingCode.getWeekday(Number(dateCode));
|
|
@@ -227,7 +228,12 @@ var TurfAvailability = /** @class */ (function () {
|
|
|
227
228
|
});
|
|
228
229
|
}
|
|
229
230
|
}
|
|
230
|
-
return
|
|
231
|
+
return {
|
|
232
|
+
fromDateCode: dateCodes[0],
|
|
233
|
+
toDateCode: dateCodes[dateCodes.length - 1],
|
|
234
|
+
data: data,
|
|
235
|
+
pitchIds: eventCodes[3].split(","),
|
|
236
|
+
};
|
|
231
237
|
};
|
|
232
238
|
TurfAvailability.prototype.parse = function () {
|
|
233
239
|
if (!Object.keys(this.data).length)
|