turf-common 1.4.2-beta.12 → 1.4.2-beta.13
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.
|
@@ -45,7 +45,7 @@ export declare class BookingCode {
|
|
|
45
45
|
static getWeekday(dateCode: number): number;
|
|
46
46
|
static convertToDate(str: string): Date;
|
|
47
47
|
static previousDateChecker(fromDate: number, index: number, errorKey?: string): void;
|
|
48
|
-
static previousTimeChecker(fromTime: string, fromDate: number, index: number): void;
|
|
48
|
+
static previousTimeChecker(fromTime: string, fromDate: number, index: number, bookingDelayInMinutes?: number): void;
|
|
49
49
|
static getDateCodesByWeek(fromDate: number, toDate: number, selectedWeekday: number): string[];
|
|
50
50
|
static getDatesByWeek(fromDate: number, toDate: number, selectedWeekday: number): Date[];
|
|
51
51
|
static isValidTimeRange(timeSlot: string): boolean;
|
|
@@ -233,15 +233,16 @@ var BookingCode = /** @class */ (function () {
|
|
|
233
233
|
}
|
|
234
234
|
};
|
|
235
235
|
//---------------------
|
|
236
|
-
BookingCode.previousTimeChecker = function (fromTime, fromDate, index) {
|
|
236
|
+
BookingCode.previousTimeChecker = function (fromTime, fromDate, index, bookingDelayInMinutes) {
|
|
237
|
+
if (bookingDelayInMinutes === void 0) { bookingDelayInMinutes = _utils_1.DEFAULT_BOOKING_DELAY_IN_MINUTES; }
|
|
237
238
|
var now = new Date();
|
|
238
239
|
this.convertToDate(fromDate.toString());
|
|
239
|
-
|
|
240
|
+
// const delayInBooking = 15;
|
|
240
241
|
if (this.convertToDate(fromDate.toString()) > now) {
|
|
241
242
|
return; //do nothing if fromDate is in future
|
|
242
243
|
}
|
|
243
244
|
else if (this.convertToDate(fromDate.toString()) <= now) {
|
|
244
|
-
now.setMinutes(now.getMinutes() -
|
|
245
|
+
now.setMinutes(now.getMinutes() - bookingDelayInMinutes); // 15minutes buffer for late bookings
|
|
245
246
|
var options = {
|
|
246
247
|
timeZone: "Asia/Kolkata",
|
|
247
248
|
};
|
|
@@ -3,3 +3,4 @@ export declare const DEFAULT_PASSWORD = "turf@#123";
|
|
|
3
3
|
export declare const DELETED_SLOT_SEPARATOR = "d_";
|
|
4
4
|
export declare const START_OF_DAY_TIME_CODE = "0000";
|
|
5
5
|
export declare const END_OF_DAY_TIME_CODE = "2400";
|
|
6
|
+
export declare const DEFAULT_BOOKING_DELAY_IN_MINUTES = 15;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.END_OF_DAY_TIME_CODE = exports.START_OF_DAY_TIME_CODE = exports.DELETED_SLOT_SEPARATOR = exports.DEFAULT_PASSWORD = exports.SUBSCRIPTION_RENEWAL_THRESHOLD_DAYS = void 0;
|
|
3
|
+
exports.DEFAULT_BOOKING_DELAY_IN_MINUTES = exports.END_OF_DAY_TIME_CODE = exports.START_OF_DAY_TIME_CODE = exports.DELETED_SLOT_SEPARATOR = exports.DEFAULT_PASSWORD = exports.SUBSCRIPTION_RENEWAL_THRESHOLD_DAYS = void 0;
|
|
4
4
|
exports.SUBSCRIPTION_RENEWAL_THRESHOLD_DAYS = 7;
|
|
5
5
|
exports.DEFAULT_PASSWORD = "turf@#123";
|
|
6
6
|
exports.DELETED_SLOT_SEPARATOR = "d_";
|
|
7
7
|
exports.START_OF_DAY_TIME_CODE = "0000";
|
|
8
8
|
exports.END_OF_DAY_TIME_CODE = "2400";
|
|
9
|
+
exports.DEFAULT_BOOKING_DELAY_IN_MINUTES = 15;
|