turf-common 1.2.1-beta.57 → 1.2.1-beta.59
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.
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.TurfAvailability = void 0;
|
|
4
|
+
var _utils_1 = require("../@utils");
|
|
4
5
|
var booking_code_model_1 = require("./booking-code-model");
|
|
5
6
|
var TurfAvailability = /** @class */ (function () {
|
|
6
7
|
function TurfAvailability(data) {
|
|
@@ -193,13 +194,17 @@ var TurfAvailability = /** @class */ (function () {
|
|
|
193
194
|
var eventCodes = eventCode.split("#");
|
|
194
195
|
var dateCodeRange = eventCodes[1];
|
|
195
196
|
var timeCodeRange = eventCodes[2];
|
|
197
|
+
var weekDays = ((_a = eventCodes[4]) === null || _a === void 0 ? void 0 : _a.split(",").map(Number)) || -1;
|
|
198
|
+
var startDateCode = dateCodeRange.slice(0, 6);
|
|
199
|
+
var endDateCode = dateCodeRange.slice(6, 12);
|
|
200
|
+
var bookingDateCodes = _utils_1.dateUtilService.getBookingCodeByWeekDaysAndDateRange(startDateCode, endDateCode, weekDays);
|
|
196
201
|
return {
|
|
197
202
|
pitchCodes: eventCodes[3].split(",").map(function (id) { return id.padStart(2, "0"); }),
|
|
198
|
-
startDateCode:
|
|
199
|
-
endDateCode:
|
|
203
|
+
startDateCode: startDateCode,
|
|
204
|
+
endDateCode: endDateCode,
|
|
200
205
|
fromTimeCode: timeCodeRange.slice(0, 4),
|
|
201
206
|
toTimeCode: timeCodeRange.slice(4, 8),
|
|
202
|
-
|
|
207
|
+
bookingDateCodes: bookingDateCodes,
|
|
203
208
|
};
|
|
204
209
|
};
|
|
205
210
|
return TurfAvailability;
|
package/build/utils/date-util.js
CHANGED
|
@@ -136,7 +136,7 @@ var DateUtilService = /** @class */ (function () {
|
|
|
136
136
|
var endDateCodeCopy = Number(endDateCode);
|
|
137
137
|
bookingDateCodes.push.apply(bookingDateCodes, _model_1.BookingCode.getDateCodesByWeek(startDateCodeCopy, endDateCodeCopy, weekDay));
|
|
138
138
|
});
|
|
139
|
-
return bookingDateCodes;
|
|
139
|
+
return bookingDateCodes.map(Number).sort().map(String);
|
|
140
140
|
};
|
|
141
141
|
return DateUtilService;
|
|
142
142
|
}());
|