tripstorekrabi-shared 1.11.9 → 1.12.1
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.
- package/booking.js +0 -35
- package/package.json +1 -1
- package/utils.js +0 -15
package/booking.js
CHANGED
|
@@ -126,41 +126,6 @@ export function addBookingFromInvoice(firestore, admin, invoice, paymentData, co
|
|
|
126
126
|
});
|
|
127
127
|
}
|
|
128
128
|
|
|
129
|
-
export function getStartingPointMessage(booking) {
|
|
130
|
-
let text = booking.startingPointDescription;
|
|
131
|
-
if (booking.pickupTime.indexOf('-') != -1) {
|
|
132
|
-
text +=
|
|
133
|
-
' between ' +
|
|
134
|
-
booking.pickupTime.replace(' - ', ' and ').replace('-', ' and ');
|
|
135
|
-
} else {
|
|
136
|
-
text += ' at ' + booking.pickupTime;
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
let now = dayjs().tz("Asia/Bangkok");
|
|
140
|
-
let dayjsDate = dayjs.tz(booking.departureDate.toDate(), "Asia/Bangkok");
|
|
141
|
-
let date = dayjsDate.format('Do MMM');
|
|
142
|
-
|
|
143
|
-
if (
|
|
144
|
-
now.add(1, 'day').isSame(dayjsDate, 'day')
|
|
145
|
-
) {
|
|
146
|
-
text += ' tomorrow the ' + date;
|
|
147
|
-
} else if (now.isSame(dayjsDate, 'day')) {
|
|
148
|
-
text += ' today the ' + date;
|
|
149
|
-
} else {
|
|
150
|
-
text += ' on the ' + date;
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
text += '. Please watch out for the staff of ' + booking.operator + '.';
|
|
154
|
-
|
|
155
|
-
if (booking.specialRequirements) {
|
|
156
|
-
text +=
|
|
157
|
-
'\n\nSPECIAL REQUIREMENTS: ' +
|
|
158
|
-
booking.specialRequirements.toUpperCase();
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
return text;
|
|
162
|
-
}
|
|
163
|
-
|
|
164
129
|
export function getOperatorSignature(agent, operatorName) {
|
|
165
130
|
let signature =
|
|
166
131
|
'<br><br>Warm regards,<br><br>' + (agent ? agent + ' - ' : "") + operatorName;
|
package/package.json
CHANGED
package/utils.js
CHANGED
|
@@ -197,17 +197,6 @@ export function validateName(name) {
|
|
|
197
197
|
}
|
|
198
198
|
}
|
|
199
199
|
|
|
200
|
-
export function applySchedule(schedule, schedules, pickupZones, includeZonePrice = false) {
|
|
201
|
-
let index = schedules.indexOf(schedule);
|
|
202
|
-
return pickupZones.map((zone) => {
|
|
203
|
-
let zoneArray = zone.split(": ");
|
|
204
|
-
let zoneName = zoneArray[0].trim();
|
|
205
|
-
let zonePickupTimes = zoneArray[1].trim();
|
|
206
|
-
let pickupTimes = zonePickupTimes.split("/");
|
|
207
|
-
return pickupTimes[index] ? (includeZonePrice ? zoneName : zoneName.replace(/ *\([^)]*\) */g, "")) + ": " + pickupTimes[index].trim() : undefined;
|
|
208
|
-
}).filter((item) => item !== undefined);
|
|
209
|
-
}
|
|
210
|
-
|
|
211
200
|
export function scrollContainer() {
|
|
212
201
|
return document.documentElement || document.body;
|
|
213
202
|
}
|
|
@@ -543,10 +532,6 @@ export function isAirbnbBooking(referenceNumber) {
|
|
|
543
532
|
return referenceNumber.startsWith("Airbnb-");
|
|
544
533
|
}
|
|
545
534
|
|
|
546
|
-
export function isAirAsiaBooking(referenceNumber) {
|
|
547
|
-
return referenceNumber.startsWith("AirAsia-");
|
|
548
|
-
}
|
|
549
|
-
|
|
550
535
|
export function isKKdayBooking(referenceNumber) {
|
|
551
536
|
return referenceNumber.startsWith("KKday-");
|
|
552
537
|
}
|