turf-common 1.2.1-beta.52 → 1.2.1-beta.54

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.
@@ -25,6 +25,7 @@ export declare class TurfAvailability implements ITurfAvailability {
25
25
  fromTimeCode: string;
26
26
  toTimeCode: string;
27
27
  pitchCodes: string[];
28
+ weekDays: number[];
28
29
  constructor(data: IGetAvailabilityByTurf);
29
30
  getTotalAvailablePrice(): number;
30
31
  getTotalNonAvailablePrice(): number;
@@ -49,6 +50,7 @@ export declare class TurfAvailability implements ITurfAvailability {
49
50
  endDateCode: string;
50
51
  fromTimeCode: string;
51
52
  toTimeCode: string;
53
+ weekDays: number[];
52
54
  };
53
55
  }
54
56
  export {};
@@ -172,7 +172,7 @@ var TurfAvailability = /** @class */ (function () {
172
172
  return this.getTotalAvailableHours() + this.getTotalNonAvailableHours();
173
173
  };
174
174
  TurfAvailability.prototype.getCode = function () {
175
- 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());
175
+ 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);
176
176
  };
177
177
  TurfAvailability.prototype.parse = function () {
178
178
  var eventCode = this.getCode();
@@ -184,6 +184,9 @@ var TurfAvailability = /** @class */ (function () {
184
184
  this.endDateCode = dateCodeRange.slice(6, 12);
185
185
  this.fromTimeCode = timeCodeRange.slice(0, 4);
186
186
  this.toTimeCode = timeCodeRange.slice(4, 8);
187
+ this.weekDays = Array.from(new Set(this.dateCodes.map(function (dateCode) {
188
+ return booking_code_model_1.BookingCode.getWeekday(Number(dateCode));
189
+ })));
187
190
  };
188
191
  TurfAvailability.parse = function (eventCode) {
189
192
  var eventCodes = eventCode.split("#");
@@ -195,6 +198,7 @@ var TurfAvailability = /** @class */ (function () {
195
198
  endDateCode: dateCodeRange.slice(6, 12),
196
199
  fromTimeCode: timeCodeRange.slice(0, 4),
197
200
  toTimeCode: timeCodeRange.slice(4, 8),
201
+ weekDays: eventCodes[4].split(",").map(Number),
198
202
  };
199
203
  };
200
204
  return TurfAvailability;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "turf-common",
3
- "version": "1.2.1-beta.52",
3
+ "version": "1.2.1-beta.54",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",