tripstorekrabi-shared 1.10.4 → 1.10.6

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/booking.js +5 -3
  2. package/package.json +1 -1
package/booking.js CHANGED
@@ -134,13 +134,15 @@ export function getStartingPointMessage(booking) {
134
134
  text += ' at ' + booking.pickupTime;
135
135
  }
136
136
 
137
- let date = dayjs(booking.departureDate.toDate()).format('Do MMM');
137
+ let now = dayjs.tz("Asia/Bangkok");
138
+ let dayjs = dayjs.tz(booking.departureDate.toDate(), "Asia/Bangkok");
139
+ let date = dayjs.format('Do MMM');
138
140
 
139
141
  if (
140
- dayjs().add(1, 'day').isSame(dayjs(booking.departureDate.toDate()), 'day')
142
+ now.add(1, 'day').isSame(dayjs, 'day')
141
143
  ) {
142
144
  text += ' tomorrow the ' + date;
143
- } else if (dayjs().isSame(dayjs(booking.departureDate.toDate()), 'day')) {
145
+ } else if (now.isSame(dayjs, 'day')) {
144
146
  text += ' today the ' + date;
145
147
  } else {
146
148
  text += ' on the ' + date;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tripstorekrabi-shared",
3
- "version": "1.10.4",
3
+ "version": "1.10.6",
4
4
  "description": "Shared library for Trip Store Krabi",
5
5
  "author": "Stefan Sommer <tonprince@gmail.com>",
6
6
  "repository": {