turf-common 1.2.1-beta.17 → 1.2.1-beta.19

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.
@@ -96,4 +96,5 @@ export declare class BookingCode {
96
96
  fromDateCode: string;
97
97
  toDateCode: string;
98
98
  };
99
+ static getTotalTimeByBookingCodes(bookingCodes: BookingCode[]): number;
99
100
  }
@@ -539,6 +539,13 @@ var BookingCode = /** @class */ (function () {
539
539
  : this.dateCode).concat(this.toTimeCode);
540
540
  return { fromDateCode: fromDateCode, toDateCode: toDateCode };
541
541
  };
542
+ BookingCode.getTotalTimeByBookingCodes = function (bookingCodes) {
543
+ var totalBookingHours = 0;
544
+ bookingCodes.forEach(function (bookingCode) {
545
+ totalBookingHours += new BookingCode(bookingCode.code).getTotalTime("hr");
546
+ });
547
+ return totalBookingHours;
548
+ };
542
549
  return BookingCode;
543
550
  }());
544
551
  exports.BookingCode = BookingCode;
@@ -65,6 +65,10 @@ var DateUtilService = /** @class */ (function () {
65
65
  };
66
66
  DateUtilService.prototype.calculateDateDifference = function (fromDateCode, toDateCode, unit) {
67
67
  if (unit === void 0) { unit = "minute"; }
68
+ if (toDateCode.slice(-4, -2) === "24") {
69
+ toDateCode =
70
+ exports.dateUtilService.addNDaysToDateCode(toDateCode.slice(0, -4), 1) + "0000";
71
+ }
68
72
  var fromDate = (0, date_fns_1.parse)(fromDateCode, "yyMMddHHmm", new Date());
69
73
  var toDate = (0, date_fns_1.parse)(toDateCode, "yyMMddHHmm", new Date());
70
74
  var minutesDifference = (0, date_fns_1.differenceInMinutes)(toDate, fromDate);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "turf-common",
3
- "version": "1.2.1-beta.17",
3
+ "version": "1.2.1-beta.19",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",