tripstorekrabi-shared 1.7.6 → 1.7.8

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/utils.js +7 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tripstorekrabi-shared",
3
- "version": "1.7.6",
3
+ "version": "1.7.8",
4
4
  "description": "Shared library for Trip Store Krabi",
5
5
  "author": "Stefan Sommer <tonprince@gmail.com>",
6
6
  "repository": {
package/utils.js CHANGED
@@ -5,7 +5,6 @@ import isSameOrBefore from "dayjs/plugin/isSameOrBefore.js";
5
5
  import utc from 'dayjs/plugin/utc.js';
6
6
  import timezone from 'dayjs/plugin/timezone.js';
7
7
  import { findEndPoint, findStartingPoint } from "./price.js";
8
- import fetch from "node-fetch";
9
8
 
10
9
  dayjs.extend(customParseFormat);
11
10
  dayjs.extend(advancedFormat);
@@ -298,7 +297,13 @@ export function getBookingSummary(booking, options = {}) {
298
297
 
299
298
  if (booking.productDescription && booking.operator && booking.departureDate && booking.schedule && booking.leadTraveller) {
300
299
  let departureDate = dayjs(booking.departureDate.toDate()).tz("Asia/Bangkok").format("DD.MM.YYYY");
301
- summary += booking.productDescription + ", " + departureDate + ", " + booking.operator + ", " + booking.adults + ", " + booking.children + ", "
300
+ summary += booking.productDescription + ", " + departureDate;
301
+
302
+ if (!options.hideOperator) {
303
+ summary += ", " + booking.operator;
304
+ }
305
+
306
+ summary += ", " + booking.adults + ", " + booking.children + ", "
302
307
  + booking.infants + ", " + booking.leadTraveller;
303
308
 
304
309
  if (booking.startingPointDescription) {