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.
|
@@ -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;
|
package/build/utils/date-util.js
CHANGED
|
@@ -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);
|