turf-common 1.2.1-beta.62 → 1.2.1-beta.64
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.
|
@@ -13,7 +13,8 @@ var TurfAvailability = /** @class */ (function () {
|
|
|
13
13
|
var key = _a[0], value = _a[1];
|
|
14
14
|
_this.timeSlotCodesDateWise[key] = Object.keys(value).sort();
|
|
15
15
|
});
|
|
16
|
-
|
|
16
|
+
if (Object.keys(data))
|
|
17
|
+
this.parse();
|
|
17
18
|
}
|
|
18
19
|
TurfAvailability.prototype.getTotalAvailablePrice = function () {
|
|
19
20
|
var totalCost = 0;
|
|
@@ -173,6 +174,8 @@ var TurfAvailability = /** @class */ (function () {
|
|
|
173
174
|
return this.getTotalAvailableHours() + this.getTotalNonAvailableHours();
|
|
174
175
|
};
|
|
175
176
|
TurfAvailability.prototype.getCode = function () {
|
|
177
|
+
if (Object.keys(this.data).length)
|
|
178
|
+
return "";
|
|
176
179
|
return "event#".concat(this.dateCodes[0]).concat(this.dateCodes[this.dateCodes.length - 1], "#").concat(this.timeSlotCodesDateWise[this.dateCodes[0]][0].slice(0, 4)).concat(this.timeSlotCodesDateWise[this.dateCodes[0]][this.timeSlotCodesDateWise[this.dateCodes[0]].length - 1].slice(4, 8), "#").concat(this.getPitchIds(), "#").concat(this.weekDays);
|
|
177
180
|
};
|
|
178
181
|
TurfAvailability.prototype.parse = function () {
|
|
@@ -197,7 +200,7 @@ var TurfAvailability = /** @class */ (function () {
|
|
|
197
200
|
var weekDays = ((_a = eventCodes[4]) === null || _a === void 0 ? void 0 : _a.split(",").map(Number)) || [-1];
|
|
198
201
|
var startDateCode = dateCodeRange.slice(0, 6);
|
|
199
202
|
var endDateCode = dateCodeRange.slice(6, 12);
|
|
200
|
-
var bookingDateCodes = weekDays.includes(-1)
|
|
203
|
+
var bookingDateCodes = !weekDays.includes(-1)
|
|
201
204
|
? _utils_1.dateUtilService.getBookingCodeByWeekDaysAndDateRange(startDateCode, endDateCode, weekDays)
|
|
202
205
|
: [];
|
|
203
206
|
return {
|