esoftplay-event 0.0.0-z → 0.0.1-a

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/event/detail.tsx CHANGED
@@ -24,6 +24,41 @@ import React, { useEffect } from 'react';
24
24
  import { Linking, Pressable, Text, TouchableOpacity, View } from 'react-native';
25
25
  import MapView, { Marker } from 'react-native-maps';
26
26
 
27
+ function timezoneCorrection(input: string | Date, timezone: string): string {
28
+ const tzMap: Record<string, string> = {
29
+ 'GMT+7': 'Asia/Jakarta',
30
+ 'GMT+8': 'Asia/Singapore',
31
+ 'GMT+9': 'Asia/Tokyo'
32
+ };
33
+
34
+ const tzString = tzMap[timezone] || 'Asia/Jakarta';
35
+
36
+ let date: Date;
37
+ if (typeof input === 'string') {
38
+ const iso = input.replace(' ', 'T') + '+07:00';
39
+ date = new Date(iso);
40
+ } else {
41
+ date = input;
42
+ }
43
+
44
+ const options: Intl.DateTimeFormatOptions = {
45
+ timeZone: tzString,
46
+ year: 'numeric',
47
+ month: '2-digit',
48
+ day: '2-digit',
49
+ hour: '2-digit',
50
+ minute: '2-digit',
51
+ second: '2-digit',
52
+ hour12: false,
53
+ };
54
+
55
+ const formatted = date.toLocaleString('en-GB', options)
56
+ const [datePart, timePart] = formatted.split(', ')
57
+ const [day, month, year] = datePart.split('/')
58
+
59
+ return `${year}-${month}-${day} ${timePart}`
60
+ }
61
+
27
62
  export interface EventDetailProps {
28
63
 
29
64
  }
@@ -256,7 +291,11 @@ export default function m(props: EventDetailProps): any {
256
291
  <View style={{ height: 35, borderRadius: 17, backgroundColor: LibStyle.colorLightGrey, justifyContent: 'center', alignItems: 'center', paddingHorizontal: 9 }} >
257
292
  <Text allowFontScaling={false} style={{ fontFamily: "ArialBold", fontSize: 12, textAlign: "center", textAlignVertical: 'center', color: 'black', marginHorizontal: 10 }} >
258
293
  {
259
- esp.lang("event/detail", "text_book_on", moment(result.start_booking).serverFormat('DD MMMM YYYY H:mm:ss'))
294
+ esp.lang("event/detail", "text_book_on",
295
+ !!result?.timezone ?
296
+ moment(timezoneCorrection(result.start_booking, result?.timezone)).format('DD MMMM YYYY H:mm:ss', true)
297
+ : moment(result.start_booking).serverFormat('DD MMMM YYYY H:mm:ss')
298
+ , result?.timezone_locale || "")
260
299
  }
261
300
  </Text>
262
301
  </View>
@@ -294,7 +333,8 @@ export default function m(props: EventDetailProps): any {
294
333
  is_subscribed: result?.config?.is_subscribed,
295
334
  is_subscribed_default: result?.config?.is_subscribed_default,
296
335
  is_subscribed_label: result?.config?.is_subscribed_label
297
- }
336
+ },
337
+ show_fee_percentage: result?.config?.show_fee_percentage
298
338
  })
299
339
  })
300
340
  } else {
@@ -310,7 +350,8 @@ export default function m(props: EventDetailProps): any {
310
350
  is_subscribed: result?.config?.is_subscribed,
311
351
  is_subscribed_default: result?.config?.is_subscribed_default,
312
352
  is_subscribed_label: result?.config?.is_subscribed_label
313
- }
353
+ },
354
+ show_fee_percentage: result?.config?.show_fee_percentage
314
355
  })
315
356
  }
316
357
 
@@ -134,7 +134,7 @@ export default function m(props: EventTicket_listProps): any {
134
134
 
135
135
  const [pendingData] = EventLoading_pageProperty.state().useState()
136
136
 
137
- const { url, fee_platform, has_addition, has_addition_global, subscribed }: any = useRef(LibNavigation.getArgsAll(props)).current
137
+ const { url, fee_platform, has_addition, has_addition_global, subscribed, show_fee_percentage }: any = useRef(LibNavigation.getArgsAll(props)).current
138
138
 
139
139
  const [deeplinkParams] = UseDeeplinkProperty.params.useState()
140
140
  const [timer] = EventCountdownProperty.countdownTime.useState()
@@ -270,6 +270,7 @@ export default function m(props: EventTicket_listProps): any {
270
270
  dataBookingEvent: { ...newDataPost, qty: getQty() },
271
271
  subscribed: subscribed,
272
272
  url_payment: urlPayment,
273
+ show_fee_percentage
273
274
  })
274
275
  })
275
276
  } else {
@@ -280,6 +281,7 @@ export default function m(props: EventTicket_listProps): any {
280
281
  dataBookingEvent: { ...newDataPost, qty: getQty() },
281
282
  subscribed: subscribed,
282
283
  url_payment: urlPayment,
284
+ show_fee_percentage
283
285
  })
284
286
  }
285
287
  }
@@ -294,7 +296,8 @@ export default function m(props: EventTicket_listProps): any {
294
296
  // tak arahke halaman seng anyar
295
297
  LibNavigation.navigate('payment/event_invitation', {
296
298
  dataBookingEvent: dataPost,
297
- subscribed: subscribed
299
+ subscribed: subscribed,
300
+ show_fee_percentage
298
301
  })
299
302
  } else if (selectedTicket?.use_seat == 1) {
300
303
  if (selectedTicket?.config && selectedTicket?.config?.seat_autopick == 1) {
@@ -135,7 +135,7 @@ export default function m(props: EventTicket_list2Props): any {
135
135
 
136
136
  const [pendingData] = EventLoading_pageProperty.state().useState()
137
137
 
138
- const { has_addition, has_addition_global, url, fee_platform, subscribed }: any = useRef(LibNavigation.getArgsAll(props)).current
138
+ const { has_addition, has_addition_global, url, fee_platform, subscribed, show_fee_percentage }: any = useRef(LibNavigation.getArgsAll(props)).current
139
139
 
140
140
  const [deeplinkParams] = UseDeeplinkProperty.params.useState()
141
141
  const [timer] = EventCountdownProperty.countdownTime.useState()
@@ -173,6 +173,7 @@ export default function m(props: EventTicket_list2Props): any {
173
173
  }
174
174
  }
175
175
  },
176
+ show_fee_percentage
176
177
  }, item.list_id)
177
178
  .then((value: any) => {
178
179
  const merged = { ...item, ...value }
@@ -259,6 +260,7 @@ export default function m(props: EventTicket_list2Props): any {
259
260
  dataTicket: getDataPostBooking(),
260
261
  subscribed: subscribed,
261
262
  url_payment: urlPayment,
263
+ show_fee_percentage
262
264
  })
263
265
  })
264
266
 
package/id.json CHANGED
@@ -533,7 +533,7 @@
533
533
  "start_from": "mulai dari %s",
534
534
  "tb_announce": "To Be Announced",
535
535
  "text_about_event": "Tentang Acara",
536
- "text_book_on": "Booking On %s",
536
+ "text_book_on": "Booking On %s %s",
537
537
  "text_booking_end": "Booking Tiket Telah Berakhir",
538
538
  "text_buy_ticket": "Beli Tiket",
539
539
  "text_event_cat": "Kategori Event",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "esoftplay-event",
3
- "version": "0.0.0-z",
3
+ "version": "0.0.1-a",
4
4
  "description": "event module on esoftplay framework",
5
5
  "main": "index.js",
6
6
  "scripts": {