kupos-ui-components-lib 4.0.9 → 5.0.0

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.
@@ -2,7 +2,115 @@ import React from "react";
2
2
  import DateService from "../../utils/DateService";
3
3
  import PaymentItem from "./PaymentItem";
4
4
  import CommonService from "../../utils/CommonService";
5
- const renderSummaryDetailsCard = ({ serviceName, date, source, dest, boardingStage, boardingTime, droppingStage, droppingTime, duration, trainType, isTrain, icons, }) => {
5
+ const renderSummaryDetailsCard = ({ serviceName, date, source, dest, boardingStage, boardingTime, droppingStage, droppingTime, duration, trainType, isTrain, icons, journeyTypeActive, cleanedTime, cleanBoardingTime, isLinatal, }) => {
6
+ // REMOVED AM/PM DUPLICATION AND ADDED 24 HOUR TIME FORMAT IN BOARDING STAGE
7
+ const depTime = boardingTime || "";
8
+ const returnTime = boardingTime || "";
9
+ const hasAM = depTime.includes("AM");
10
+ const hasPM = depTime.includes("PM");
11
+ const [timePart] = depTime.split(/AM|PM/).map((part) => part.trim());
12
+ const [hour, minute] = timePart.split(":").map(Number);
13
+ let cleanedDepTime;
14
+ if (hasAM) {
15
+ cleanedDepTime =
16
+ hour === 12
17
+ ? `00:${minute < 10 ? "0" + minute : minute}`
18
+ : `${hour < 10 ? "0" + hour : hour}:${minute < 10 ? "0" + minute : minute}`;
19
+ }
20
+ else if (hasPM) {
21
+ cleanedDepTime =
22
+ hour === 12
23
+ ? `${hour}:${minute < 10 ? "0" + minute : minute}`
24
+ : `${hour + 12}:${minute < 10 ? "0" + minute : minute}`;
25
+ }
26
+ else {
27
+ cleanedDepTime = timePart;
28
+ console.log("🚀 ~ cleanedDepTime:", cleanedDepTime);
29
+ }
30
+ let cleanBoardingReturnTime;
31
+ const hasBoardingReturnAM = returnTime.includes("AM");
32
+ const hasBoardingReturnPM = returnTime.includes("PM");
33
+ const [returnTimePart] = returnTime.split(/AM|PM/).map((part) => part.trim());
34
+ const [droppingReturnHour, returnMinute] = returnTimePart
35
+ .split(":")
36
+ .map(Number);
37
+ if (returnTime) {
38
+ if (hasBoardingReturnAM) {
39
+ cleanBoardingReturnTime =
40
+ droppingReturnHour === 12
41
+ ? `00:${returnMinute < 10 ? "0" + returnMinute : returnMinute}`
42
+ : `${droppingReturnHour < 10
43
+ ? "0" + droppingReturnHour
44
+ : droppingReturnHour}:${returnMinute < 10 ? "0" + returnMinute : returnMinute}`;
45
+ }
46
+ else if (hasBoardingReturnPM) {
47
+ cleanBoardingReturnTime =
48
+ droppingReturnHour === 12
49
+ ? `${droppingReturnHour}:${returnMinute < 10 ? "0" + returnMinute : returnMinute}`
50
+ : `${droppingReturnHour + 12}:${returnMinute < 10 ? "0" + returnMinute : returnMinute}`;
51
+ }
52
+ else {
53
+ cleanBoardingReturnTime = returnTimePart;
54
+ }
55
+ console.log("🚀 ~ cleanBoardingReturnTime:", cleanBoardingReturnTime);
56
+ }
57
+ // REMOVED AM/PM DUPLICATION AND ADDED 24 HOUR TIME FORMAT IN DROPPING STAGE
58
+ const dropdDepTime = droppingTime || "";
59
+ const dropReturnTime = droppingTime || "";
60
+ const dropHasAM = dropdDepTime.includes("AM");
61
+ const dropHasPM = dropdDepTime.includes("PM");
62
+ const [timePartDrop] = dropdDepTime.split(/AM|PM/).map((part) => part.trim());
63
+ const [hourDrop, minuteDrop] = timePartDrop.split(":").map(Number);
64
+ let cleanedDropDepTime = "";
65
+ if (dropHasAM) {
66
+ cleanedDropDepTime =
67
+ hourDrop === 12
68
+ ? `00:${minuteDrop < 10 ? "0" + minuteDrop : minuteDrop}`
69
+ : `${hourDrop < 10 ? "0" + hourDrop : hourDrop}:${minuteDrop < 10 ? "0" + minuteDrop : minuteDrop}`;
70
+ }
71
+ else if (dropHasPM) {
72
+ cleanedDropDepTime =
73
+ hourDrop === 12
74
+ ? `${hourDrop}:${minuteDrop < 10 ? "0" + minuteDrop : minuteDrop}`
75
+ : `${hourDrop + 12}:${minuteDrop < 10 ? "0" + minuteDrop : minuteDrop}`;
76
+ }
77
+ else {
78
+ cleanedDropDepTime = timePartDrop;
79
+ }
80
+ let cleanDroppingReturnTime;
81
+ const hasDroppingReturnAM = dropReturnTime.includes("AM");
82
+ const hasDroppingReturnPM = dropReturnTime.includes("PM");
83
+ const [droppingReturnTimePart] = dropReturnTime
84
+ .split(/AM|PM/)
85
+ .map((part) => part.trim());
86
+ const [returnHour, droppingReturnMinute] = droppingReturnTimePart
87
+ .split(":")
88
+ .map(Number);
89
+ if (returnTime) {
90
+ if (hasDroppingReturnAM) {
91
+ cleanDroppingReturnTime =
92
+ returnHour === 12
93
+ ? `00:${droppingReturnMinute < 10
94
+ ? "0" + droppingReturnMinute
95
+ : droppingReturnMinute}`
96
+ : `${returnHour < 10 ? "0" + returnHour : returnHour}:${droppingReturnMinute < 10
97
+ ? "0" + droppingReturnMinute
98
+ : droppingReturnMinute}`;
99
+ }
100
+ else if (hasDroppingReturnPM) {
101
+ cleanDroppingReturnTime =
102
+ returnHour === 12
103
+ ? `${returnHour}:${droppingReturnMinute < 10
104
+ ? "0" + droppingReturnMinute
105
+ : droppingReturnMinute}`
106
+ : `${returnHour + 12}:${droppingReturnMinute < 10
107
+ ? "0" + droppingReturnMinute
108
+ : droppingReturnMinute}`;
109
+ }
110
+ else {
111
+ cleanDroppingReturnTime = returnTimePart;
112
+ }
113
+ }
6
114
  return (React.createElement(React.Fragment, null,
7
115
  React.createElement("div", { className: "mt-3 border-b border-[#ccc] pb-3 text-[13.33px]" },
8
116
  React.createElement("div", { className: "summary-details-card" },
@@ -23,7 +131,22 @@ const renderSummaryDetailsCard = ({ serviceName, date, source, dest, boardingSta
23
131
  React.createElement("div", { className: "ml-7 text-xs mt-[5px]" },
24
132
  boardingStage,
25
133
  ". ",
26
- boardingTime ? (React.createElement("span", null, DateService.formatTime(boardingTime))) : null)),
134
+ boardingTime && isLinatal ? (boardingTime.includes("AM") || boardingTime.includes("PM") ? (React.createElement("span", null,
135
+ journeyTypeActive === 1
136
+ ? cleanedDepTime
137
+ : cleanBoardingReturnTime,
138
+ " ",
139
+ journeyTypeActive === 1
140
+ ? hasPM
141
+ ? "PM"
142
+ : hasAM
143
+ ? "AM"
144
+ : ""
145
+ : hasBoardingReturnPM
146
+ ? "PM"
147
+ : hasBoardingReturnAM
148
+ ? "AM"
149
+ : "")) : (React.createElement("span", null, DateService.formatTime(boardingTime)))) : null)),
27
150
  React.createElement("div", { className: "mt-3" },
28
151
  React.createElement("div", { className: "flex items-center" },
29
152
  React.createElement("div", { className: "w-5 h-5 rounded-full flex items-center justify-center mr-2" },
@@ -32,7 +155,22 @@ const renderSummaryDetailsCard = ({ serviceName, date, source, dest, boardingSta
32
155
  React.createElement("div", { className: "ml-7 text-xs mt-[5px]" },
33
156
  droppingStage,
34
157
  ". ",
35
- droppingTime ? (React.createElement("span", null, DateService.formatTime(droppingTime))) : null)),
158
+ droppingTime && isLinatal ? (droppingTime.includes("AM") || droppingTime.includes("PM") ? (React.createElement("span", null,
159
+ journeyTypeActive === 1
160
+ ? cleanedDropDepTime
161
+ : cleanDroppingReturnTime,
162
+ " ",
163
+ journeyTypeActive === 1
164
+ ? hasPM
165
+ ? "PM"
166
+ : hasAM
167
+ ? "AM"
168
+ : ""
169
+ : hasDroppingReturnPM
170
+ ? "PM"
171
+ : hasDroppingReturnAM
172
+ ? "AM"
173
+ : "")) : (React.createElement("span", null, DateService.formatTime(droppingTime)))) : null)),
36
174
  duration && (React.createElement("div", { className: "mt-3 flex items-center text-xs text-gray-500" },
37
175
  React.createElement("div", { className: " flex items-center justify-center mr-2" },
38
176
  React.createElement("img", { src: icons === null || icons === void 0 ? void 0 : icons.hours, className: "w-[16px] h-[16px] mr-[5px]" })),
@@ -41,7 +179,115 @@ const renderSummaryDetailsCard = ({ serviceName, date, source, dest, boardingSta
41
179
  duration,
42
180
  " horas")))))));
43
181
  };
44
- const PaymentSideBarDesktop = ({ serviceNameOnward, serviceNameReturn, metaData, currencySign, dateOnward, dateReturn, sourceOnward, sourceReturn, destinationOnward, destinationReturn, boardingStageOnward, boardingStageReturn, droppingStageOnward, droppingStageReturn, boardingTimeOnward, boardingTimeReturn, droppingTimeOnward, droppingTimeReturn, durationOnward, durationReturn, selectSeatOnward, selectSeatReturn, journeyTypeActive, setJourneyTypeActive, translation, trainTypeOnward, trainTypeReturn, colors, trainType, icons, selectedOnward, selectedReturn, conexionChecked, conexionPassengers, returnConexionFare, conexionFare, loginData, checkWhatsappEligibility, removeDiscountAtomValue, netFare, promoCode, onPromoRemove, isAgency, agencyFee, walletMoney, virtualMoney, virtualLimit, showUsd, netFareInUsd, renderDiscount, discountAmount, walletLabel, creditosLabel, currency, customSideBarwidth, }) => {
182
+ const PaymentSideBarDesktop = ({ serviceNameOnward, serviceNameReturn, metaData, currencySign, dateOnward, dateReturn, sourceOnward, sourceReturn, destinationOnward, destinationReturn, boardingStageOnward, boardingStageReturn, droppingStageOnward, droppingStageReturn, boardingTimeOnward, boardingTimeReturn, droppingTimeOnward, droppingTimeReturn, durationOnward, durationReturn, selectSeatOnward, selectSeatReturn, journeyTypeActive, setJourneyTypeActive, translation, trainTypeOnward, trainTypeReturn, colors, trainType, icons, selectedOnward, selectedReturn, conexionChecked, conexionPassengers, returnConexionFare, conexionFare, loginData, checkWhatsappEligibility, removeDiscountAtomValue, netFare, promoCode, onPromoRemove, isAgency, agencyFee, walletMoney, virtualMoney, virtualLimit, showUsd, netFareInUsd, renderDiscount, discountAmount, walletLabel, creditosLabel, currency, customSideBarwidth, isLinatal, }) => {
183
+ // REMOVED AM/PM DUPLICATION AND ADDED 24 HOUR TIME FORMAT IN BOARDING STAGE
184
+ const depTime = droppingTimeOnward || "";
185
+ const returnTime = droppingTimeReturn || "";
186
+ const hasAM = depTime.includes("AM");
187
+ const hasPM = depTime.includes("PM");
188
+ const [timePart] = depTime.split(/AM|PM/).map((part) => part.trim());
189
+ const [hour, minute] = timePart.split(":").map(Number);
190
+ let cleanedDepTime;
191
+ if (hasAM) {
192
+ cleanedDepTime =
193
+ hour === 12
194
+ ? `00:${minute < 10 ? "0" + minute : minute}`
195
+ : `${hour < 10 ? "0" + hour : hour}:${minute < 10 ? "0" + minute : minute}`;
196
+ }
197
+ else if (hasPM) {
198
+ cleanedDepTime =
199
+ hour === 12
200
+ ? `${hour}:${minute < 10 ? "0" + minute : minute}`
201
+ : `${hour + 12}:${minute < 10 ? "0" + minute : minute}`;
202
+ }
203
+ else {
204
+ cleanedDepTime = timePart;
205
+ console.log("🚀 ~ cleanedDepTime:", cleanedDepTime);
206
+ }
207
+ let cleanBoardingReturnTime;
208
+ const hasBoardingReturnAM = returnTime.includes("AM");
209
+ const hasBoardingReturnPM = returnTime.includes("PM");
210
+ const [returnTimePart] = returnTime.split(/AM|PM/).map((part) => part.trim());
211
+ const [droppingReturnHour, returnMinute] = returnTimePart
212
+ .split(":")
213
+ .map(Number);
214
+ if (returnTime) {
215
+ if (hasBoardingReturnAM) {
216
+ cleanBoardingReturnTime =
217
+ droppingReturnHour === 12
218
+ ? `00:${returnMinute < 10 ? "0" + returnMinute : returnMinute}`
219
+ : `${droppingReturnHour < 10
220
+ ? "0" + droppingReturnHour
221
+ : droppingReturnHour}:${returnMinute < 10 ? "0" + returnMinute : returnMinute}`;
222
+ }
223
+ else if (hasBoardingReturnPM) {
224
+ cleanBoardingReturnTime =
225
+ droppingReturnHour === 12
226
+ ? `${droppingReturnHour}:${returnMinute < 10 ? "0" + returnMinute : returnMinute}`
227
+ : `${droppingReturnHour + 12}:${returnMinute < 10 ? "0" + returnMinute : returnMinute}`;
228
+ }
229
+ else {
230
+ cleanBoardingReturnTime = returnTimePart;
231
+ }
232
+ console.log("🚀 ~ cleanBoardingReturnTime:", cleanBoardingReturnTime);
233
+ }
234
+ // REMOVED AM/PM DUPLICATION AND ADDED 24 HOUR TIME FORMAT IN DROPPING STAGE
235
+ const dropdDepTime = droppingTimeOnward || "";
236
+ const dropReturnTime = droppingTimeReturn || "";
237
+ const dropHasAM = dropdDepTime.includes("AM");
238
+ const dropHasPM = dropdDepTime.includes("PM");
239
+ const [timePartDrop] = dropdDepTime.split(/AM|PM/).map((part) => part.trim());
240
+ const [hourDrop, minuteDrop] = timePartDrop.split(":").map(Number);
241
+ let cleanedDropDepTime = "";
242
+ if (dropHasAM) {
243
+ cleanedDropDepTime =
244
+ hourDrop === 12
245
+ ? `00:${minuteDrop < 10 ? "0" + minuteDrop : minuteDrop}`
246
+ : `${hourDrop < 10 ? "0" + hourDrop : hourDrop}:${minuteDrop < 10 ? "0" + minuteDrop : minuteDrop}`;
247
+ }
248
+ else if (dropHasPM) {
249
+ cleanedDropDepTime =
250
+ hourDrop === 12
251
+ ? `${hourDrop}:${minuteDrop < 10 ? "0" + minuteDrop : minuteDrop}`
252
+ : `${hourDrop + 12}:${minuteDrop < 10 ? "0" + minuteDrop : minuteDrop}`;
253
+ }
254
+ else {
255
+ cleanedDropDepTime = timePartDrop;
256
+ }
257
+ let cleanDroppingReturnTime;
258
+ const hasDroppingReturnAM = dropReturnTime.includes("AM");
259
+ const hasDroppingReturnPM = dropReturnTime.includes("PM");
260
+ const [droppingReturnTimePart] = dropReturnTime
261
+ .split(/AM|PM/)
262
+ .map((part) => part.trim());
263
+ const [returnHour, droppingReturnMinute] = droppingReturnTimePart
264
+ .split(":")
265
+ .map(Number);
266
+ if (returnTime) {
267
+ if (hasDroppingReturnAM) {
268
+ cleanDroppingReturnTime =
269
+ returnHour === 12
270
+ ? `00:${droppingReturnMinute < 10
271
+ ? "0" + droppingReturnMinute
272
+ : droppingReturnMinute}`
273
+ : `${returnHour < 10 ? "0" + returnHour : returnHour}:${droppingReturnMinute < 10
274
+ ? "0" + droppingReturnMinute
275
+ : droppingReturnMinute}`;
276
+ }
277
+ else if (hasDroppingReturnPM) {
278
+ cleanDroppingReturnTime =
279
+ returnHour === 12
280
+ ? `${returnHour}:${droppingReturnMinute < 10
281
+ ? "0" + droppingReturnMinute
282
+ : droppingReturnMinute}`
283
+ : `${returnHour + 12}:${droppingReturnMinute < 10
284
+ ? "0" + droppingReturnMinute
285
+ : droppingReturnMinute}`;
286
+ }
287
+ else {
288
+ cleanDroppingReturnTime = returnTimePart;
289
+ }
290
+ }
45
291
  return (React.createElement("div", { className: "" },
46
292
  React.createElement("div", { className: "bg-white rounded-[20px] shadow-service mb-[10px] mx-auto relative", style: { width: customSideBarwidth } },
47
293
  React.createElement("div", { className: "p-[15px]" },
@@ -82,6 +328,10 @@ const PaymentSideBarDesktop = ({ serviceNameOnward, serviceNameReturn, metaData,
82
328
  trainType: trainTypeOnward,
83
329
  isTrain: trainType,
84
330
  icons: icons,
331
+ journeyTypeActive: journeyTypeActive,
332
+ cleanedTime: cleanedDepTime,
333
+ cleanBoardingTime: null,
334
+ isLinatal: isLinatal,
85
335
  })
86
336
  : renderSummaryDetailsCard({
87
337
  serviceName: serviceNameReturn,
@@ -96,6 +346,10 @@ const PaymentSideBarDesktop = ({ serviceNameOnward, serviceNameReturn, metaData,
96
346
  trainType: trainTypeReturn,
97
347
  isTrain: trainType,
98
348
  icons: icons,
349
+ journeyTypeActive: journeyTypeActive,
350
+ cleanedTime: null,
351
+ cleanBoardingTime: cleanBoardingReturnTime,
352
+ isLinatal: isLinatal,
99
353
  })),
100
354
  React.createElement("div", { className: "mt-3 text-[13.33px]", style: { margin: checkWhatsappEligibility ? "0" : "6px 0" } },
101
355
  selectSeatOnward && selectedOnward && selectedOnward[0]
@@ -99,4 +99,5 @@ export interface PaymentSideBarProps {
99
99
  creditosLabel?: string;
100
100
  walletLabel?: string;
101
101
  customSideBarwidth?: string;
102
+ isLinatal?: boolean;
102
103
  }
@@ -1,6 +1,6 @@
1
1
  import React from "react";
2
2
  import { ServiceItemProps } from "./types";
3
- declare function ServiceItemPB({ serviceItem, onBookButtonPress, colors, metaData, children, busStage, serviceDetailsLoading, cityOrigin, cityDestination, translation, orignLabel, destinationLabel, currencySign, isCiva, showRating, showLastSeats, removeArrivalTime, removeDuplicateSeats, isPeruSites, showAvailableSeats, isSeatIcon, t, }: ServiceItemProps & {
3
+ declare function ServiceItemPB({ serviceItem, onBookButtonPress, colors, metaData, children, busStage, serviceDetailsLoading, cityOrigin, cityDestination, translation, orignLabel, destinationLabel, currencySign, isCiva, showRating, showLastSeats, removeArrivalTime, removeDuplicateSeats, isPeruSites, showAvailableSeats, isSeatIcon, isLinatal, t, }: ServiceItemProps & {
4
4
  currencySign?: string;
5
5
  }): React.ReactElement;
6
6
  export default ServiceItemPB;
@@ -7,8 +7,9 @@ import InternationalServicePopupBody from "../InternationalServicePopupBody";
7
7
  import LottiePlayer from "../../assets/LottiePlayer";
8
8
  import PeruServiceItemDesktop from "./PeruServiceItemDesktop";
9
9
  const SEAT_EXCEPTIONS = ["Asiento mascota"];
10
- function ServiceItemPB({ serviceItem, onBookButtonPress, colors, metaData, children, busStage, serviceDetailsLoading, cityOrigin, cityDestination, translation, orignLabel, destinationLabel, currencySign, isCiva, showRating, showLastSeats, removeArrivalTime, removeDuplicateSeats, isPeruSites, showAvailableSeats, isSeatIcon, t = (key) => key, }) {
10
+ function ServiceItemPB({ serviceItem, onBookButtonPress, colors, metaData, children, busStage, serviceDetailsLoading, cityOrigin, cityDestination, translation, orignLabel, destinationLabel, currencySign, isCiva, showRating, showLastSeats, removeArrivalTime, removeDuplicateSeats, isPeruSites, showAvailableSeats, isSeatIcon, isLinatal, t = (key) => key, }) {
11
11
  var _a, _b, _c, _d, _e, _f, _g;
12
+ console.log("🚀 ~ ServiceItemPB ~ isLinatal:", isLinatal);
12
13
  const SvgAmenities = ({ moreAnemities, name, color, }) => {
13
14
  var _a;
14
15
  const amenityKey = (_a = name === null || name === void 0 ? void 0 : name.toLowerCase()) === null || _a === void 0 ? void 0 : _a.replace(/\s/g, "_");
@@ -383,6 +384,29 @@ function ServiceItemPB({ serviceItem, onBookButtonPress, colors, metaData, child
383
384
  const onBookButtonPressHandler = () => {
384
385
  onBookButtonPress();
385
386
  };
387
+ const depTime = serviceItem.dep_time || "";
388
+ // Extract hours and minutes and check for AM/PM
389
+ const hasAM = depTime.includes("AM");
390
+ const hasPM = depTime.includes("PM");
391
+ const [timePart] = depTime.split(/AM|PM/).map((part) => part.trim());
392
+ const [hour, minute] = timePart.split(":").map(Number);
393
+ // Convert to 24-hour format
394
+ let cleanedDepTime;
395
+ if (hasAM) {
396
+ cleanedDepTime =
397
+ hour === 12
398
+ ? `00:${minute < 10 ? "0" + minute : minute}`
399
+ : `${hour < 10 ? "0" + hour : hour}:${minute < 10 ? "0" + minute : minute}`;
400
+ }
401
+ else if (hasPM) {
402
+ cleanedDepTime =
403
+ hour === 12
404
+ ? `${hour}:${minute < 10 ? "0" + minute : minute}`
405
+ : `${hour + 12}:${minute < 10 ? "0" + minute : minute}`;
406
+ }
407
+ else {
408
+ cleanedDepTime = timePart;
409
+ }
386
410
  return (React.createElement(React.Fragment, null, isPeruSites ? (React.createElement(PeruServiceItemDesktop, { serviceItem: serviceItem, onBookButtonPress: onBookButtonPress, colors: colors, metaData: metaData, children: children, busStage: busStage, serviceDetailsLoading: serviceDetailsLoading, cityOrigin: cityOrigin, cityDestination: cityDestination, translation: translation, orignLabel: orignLabel, destinationLabel: destinationLabel, currencySign: currencySign, isCiva: isCiva, showRating: showRating, showLastSeats: showLastSeats, removeArrivalTime: removeArrivalTime, removeDuplicateSeats: removeDuplicateSeats, isPeruSites: isPeruSites, t: (key) => t(key), showAvailableSeats: showAvailableSeats, isSeatIcon: isSeatIcon })) : (React.createElement("div", { className: `relative ${serviceItem.offer_text ? "mb-[55px]" : "mb-[10px]"} ${(serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.is_direct_trip) ||
387
411
  (serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.train_type_label) === "Tren Express (Nuevo)" ||
388
412
  showTopLabel
@@ -431,7 +455,16 @@ function ServiceItemPB({ serviceItem, onBookButtonPress, colors, metaData, child
431
455
  !isCiva && (React.createElement("div", { className: "h-[20px] flex items-center justify-center" }, removeArrivalTime ? null : serviceItem.arr_time ? (React.createElement("div", null, "\u2022")) : null))),
432
456
  React.createElement("div", { className: "flex flex-col gap-[10px]" },
433
457
  React.createElement("div", { className: "h-[20px] flex items-center group relative" },
434
- React.createElement("div", { className: "font-[900] bold-text" }, DateService.formatTime(serviceItem.dep_time)),
458
+ isLinatal ? (React.createElement("div", { className: "font-[900] bold-text" },
459
+ React.createElement("span", null,
460
+ " ",
461
+ cleanedDepTime,
462
+ " ",
463
+ React.createElement("span", null, hasPM ? "PM" : hasAM ? "AM" : "")),
464
+ (serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.dep_time.includes("AM")) ||
465
+ (serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.dep_time.includes("PM"))
466
+ ? null
467
+ : DateService.ampmOnly(serviceItem.dep_time))) : (React.createElement("div", { className: "font-[900] bold-text" }, DateService.formatTime(serviceItem.dep_time))),
435
468
  serviceItem.boarding_stages && (React.createElement("div", { className: "hidden group-hover:block absolute -top-[8px] left-[100%] ml-[25px] text-white px-3 py-2 rounded-[10px] whitespace-nowrap z-10 shadow-service", style: {
436
469
  backgroundColor: colors === null || colors === void 0 ? void 0 : colors.tooltipColor,
437
470
  zIndex: 100,
@@ -566,10 +599,8 @@ function ServiceItemPB({ serviceItem, onBookButtonPress, colors, metaData, child
566
599
  } }, metaData &&
567
600
  ((_g = serviceItem.operator_details[4]) === null || _g === void 0 ? void 0 : _g.map((val, key) => {
568
601
  var _a, _b, _c, _d, _e, _f, _g;
569
- const exceptions = [
570
- 1, 2, 5, 7, 8, 9, 12, 13, 14, 15,
571
- ];
572
- return exceptions.includes(key) ? null : key >= 3 &&
602
+ // Show all amenities with index 3 or higher, excluding WATER
603
+ return key >= 3 &&
573
604
  ((_b = (_a = metaData.amenities[val]) === null || _a === void 0 ? void 0 : _a.split(".")[0]) === null || _b === void 0 ? void 0 : _b.toUpperCase()) !== "WATER" ? (React.createElement("div", { key: key, className: "flex items-center gap-[5px] whitespace-nowrap text-[13.33px]" },
574
605
  React.createElement("div", { className: `${isSoldOut ? "grayscale" : ""}` },
575
606
  React.createElement(SvgAmenities, { moreAnemities: true, name: (_d = (_c = metaData.amenities[val]) === null || _c === void 0 ? void 0 : _c.split(".")[0]) === null || _d === void 0 ? void 0 : _d.toUpperCase(), color: "white" })),
@@ -180,4 +180,5 @@ export interface ServiceItemProps {
180
180
  isPeruSites?: boolean;
181
181
  showAvailableSeats?: boolean;
182
182
  isSeatIcon?: boolean;
183
+ isLinatal?: boolean;
183
184
  }
@@ -1,6 +1,7 @@
1
1
  declare const DateService: {
2
2
  changeDateFormat: (date: string, fromFormat?: string, toFormat?: string) => string;
3
3
  getDayname: (day: number, type?: string) => string;
4
+ ampmOnly: (time: any) => "AM" | "PM";
4
5
  getMonthName: (month: number, type?: string) => string;
5
6
  getDayNameFromDate: (date: string, format?: string, type?: string) => string;
6
7
  getDateFromDate: (date: any, format?: string) => string | number;
@@ -38,6 +38,12 @@ const DateService = {
38
38
  ];
39
39
  return type === "half" ? days[day] : fullDays[day];
40
40
  },
41
+ ampmOnly: (time) => {
42
+ if (time < "12:00") {
43
+ return "AM";
44
+ }
45
+ return "PM";
46
+ },
41
47
  getMonthName: (month, type = "half") => {
42
48
  const months = [
43
49
  "ene",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kupos-ui-components-lib",
3
- "version": "4.0.9",
3
+ "version": "5.0.0",
4
4
  "description": "A reusable UI components package",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -17,7 +17,139 @@ const renderSummaryDetailsCard = ({
17
17
  trainType,
18
18
  isTrain,
19
19
  icons,
20
+ journeyTypeActive,
21
+ cleanedTime,
22
+ cleanBoardingTime,
23
+ isLinatal,
20
24
  }) => {
25
+ // REMOVED AM/PM DUPLICATION AND ADDED 24 HOUR TIME FORMAT IN BOARDING STAGE
26
+ const depTime = boardingTime || "";
27
+ const returnTime = boardingTime || "";
28
+
29
+ const hasAM = depTime.includes("AM");
30
+ const hasPM = depTime.includes("PM");
31
+ const [timePart] = depTime.split(/AM|PM/).map((part) => part.trim());
32
+ const [hour, minute] = timePart.split(":").map(Number);
33
+
34
+ let cleanedDepTime;
35
+ if (hasAM) {
36
+ cleanedDepTime =
37
+ hour === 12
38
+ ? `00:${minute < 10 ? "0" + minute : minute}`
39
+ : `${hour < 10 ? "0" + hour : hour}:${
40
+ minute < 10 ? "0" + minute : minute
41
+ }`;
42
+ } else if (hasPM) {
43
+ cleanedDepTime =
44
+ hour === 12
45
+ ? `${hour}:${minute < 10 ? "0" + minute : minute}`
46
+ : `${hour + 12}:${minute < 10 ? "0" + minute : minute}`;
47
+ } else {
48
+ cleanedDepTime = timePart;
49
+ console.log("🚀 ~ cleanedDepTime:", cleanedDepTime);
50
+ }
51
+
52
+ let cleanBoardingReturnTime;
53
+ const hasBoardingReturnAM = returnTime.includes("AM");
54
+ const hasBoardingReturnPM = returnTime.includes("PM");
55
+ const [returnTimePart] = returnTime.split(/AM|PM/).map((part) => part.trim());
56
+ const [droppingReturnHour, returnMinute] = returnTimePart
57
+ .split(":")
58
+ .map(Number);
59
+
60
+ if (returnTime) {
61
+ if (hasBoardingReturnAM) {
62
+ cleanBoardingReturnTime =
63
+ droppingReturnHour === 12
64
+ ? `00:${returnMinute < 10 ? "0" + returnMinute : returnMinute}`
65
+ : `${
66
+ droppingReturnHour < 10
67
+ ? "0" + droppingReturnHour
68
+ : droppingReturnHour
69
+ }:${returnMinute < 10 ? "0" + returnMinute : returnMinute}`;
70
+ } else if (hasBoardingReturnPM) {
71
+ cleanBoardingReturnTime =
72
+ droppingReturnHour === 12
73
+ ? `${droppingReturnHour}:${
74
+ returnMinute < 10 ? "0" + returnMinute : returnMinute
75
+ }`
76
+ : `${droppingReturnHour + 12}:${
77
+ returnMinute < 10 ? "0" + returnMinute : returnMinute
78
+ }`;
79
+ } else {
80
+ cleanBoardingReturnTime = returnTimePart;
81
+ }
82
+
83
+ console.log("🚀 ~ cleanBoardingReturnTime:", cleanBoardingReturnTime);
84
+ }
85
+
86
+ // REMOVED AM/PM DUPLICATION AND ADDED 24 HOUR TIME FORMAT IN DROPPING STAGE
87
+ const dropdDepTime = droppingTime || "";
88
+ const dropReturnTime = droppingTime || "";
89
+
90
+ const dropHasAM = dropdDepTime.includes("AM");
91
+ const dropHasPM = dropdDepTime.includes("PM");
92
+ const [timePartDrop] = dropdDepTime.split(/AM|PM/).map((part) => part.trim());
93
+ const [hourDrop, minuteDrop] = timePartDrop.split(":").map(Number);
94
+ let cleanedDropDepTime = "";
95
+
96
+ if (dropHasAM) {
97
+ cleanedDropDepTime =
98
+ hourDrop === 12
99
+ ? `00:${minuteDrop < 10 ? "0" + minuteDrop : minuteDrop}`
100
+ : `${hourDrop < 10 ? "0" + hourDrop : hourDrop}:${
101
+ minuteDrop < 10 ? "0" + minuteDrop : minuteDrop
102
+ }`;
103
+ } else if (dropHasPM) {
104
+ cleanedDropDepTime =
105
+ hourDrop === 12
106
+ ? `${hourDrop}:${minuteDrop < 10 ? "0" + minuteDrop : minuteDrop}`
107
+ : `${hourDrop + 12}:${minuteDrop < 10 ? "0" + minuteDrop : minuteDrop}`;
108
+ } else {
109
+ cleanedDropDepTime = timePartDrop;
110
+ }
111
+
112
+ let cleanDroppingReturnTime;
113
+ const hasDroppingReturnAM = dropReturnTime.includes("AM");
114
+ const hasDroppingReturnPM = dropReturnTime.includes("PM");
115
+ const [droppingReturnTimePart] = dropReturnTime
116
+ .split(/AM|PM/)
117
+ .map((part) => part.trim());
118
+ const [returnHour, droppingReturnMinute] = droppingReturnTimePart
119
+ .split(":")
120
+ .map(Number);
121
+
122
+ if (returnTime) {
123
+ if (hasDroppingReturnAM) {
124
+ cleanDroppingReturnTime =
125
+ returnHour === 12
126
+ ? `00:${
127
+ droppingReturnMinute < 10
128
+ ? "0" + droppingReturnMinute
129
+ : droppingReturnMinute
130
+ }`
131
+ : `${returnHour < 10 ? "0" + returnHour : returnHour}:${
132
+ droppingReturnMinute < 10
133
+ ? "0" + droppingReturnMinute
134
+ : droppingReturnMinute
135
+ }`;
136
+ } else if (hasDroppingReturnPM) {
137
+ cleanDroppingReturnTime =
138
+ returnHour === 12
139
+ ? `${returnHour}:${
140
+ droppingReturnMinute < 10
141
+ ? "0" + droppingReturnMinute
142
+ : droppingReturnMinute
143
+ }`
144
+ : `${returnHour + 12}:${
145
+ droppingReturnMinute < 10
146
+ ? "0" + droppingReturnMinute
147
+ : droppingReturnMinute
148
+ }`;
149
+ } else {
150
+ cleanDroppingReturnTime = returnTimePart;
151
+ }
152
+ }
21
153
  return (
22
154
  <>
23
155
  {/* Summary Details Card */}
@@ -58,9 +190,31 @@ const renderSummaryDetailsCard = ({
58
190
  </div>
59
191
  <div className="ml-7 text-xs mt-[5px]">
60
192
  {boardingStage}. {/* {boardingTime && `. ${boardingTime}`} */}
61
- {boardingTime ? (
62
- <span>{DateService.formatTime(boardingTime)}</span>
193
+ {boardingTime && isLinatal ? (
194
+ boardingTime.includes("AM") || boardingTime.includes("PM") ? (
195
+ <span>
196
+ {journeyTypeActive === 1
197
+ ? cleanedDepTime
198
+ : cleanBoardingReturnTime}{" "}
199
+ {journeyTypeActive === 1
200
+ ? hasPM
201
+ ? "PM"
202
+ : hasAM
203
+ ? "AM"
204
+ : ""
205
+ : hasBoardingReturnPM
206
+ ? "PM"
207
+ : hasBoardingReturnAM
208
+ ? "AM"
209
+ : ""}
210
+ </span>
211
+ ) : (
212
+ <span>{DateService.formatTime(boardingTime)}</span>
213
+ )
63
214
  ) : null}
215
+ {/* {boardingTime ? (
216
+ <span>{DateService.formatTime(boardingTime)}</span>
217
+ ) : null} */}
64
218
  </div>
65
219
  </div>
66
220
 
@@ -78,9 +232,31 @@ const renderSummaryDetailsCard = ({
78
232
  </div>
79
233
  <div className="ml-7 text-xs mt-[5px]">
80
234
  {droppingStage}. {/* {droppingTime && `. ${droppingTime}`} */}
81
- {droppingTime ? (
82
- <span>{DateService.formatTime(droppingTime)}</span>
235
+ {droppingTime && isLinatal ? (
236
+ droppingTime.includes("AM") || droppingTime.includes("PM") ? (
237
+ <span>
238
+ {journeyTypeActive === 1
239
+ ? cleanedDropDepTime
240
+ : cleanDroppingReturnTime}{" "}
241
+ {journeyTypeActive === 1
242
+ ? hasPM
243
+ ? "PM"
244
+ : hasAM
245
+ ? "AM"
246
+ : ""
247
+ : hasDroppingReturnPM
248
+ ? "PM"
249
+ : hasDroppingReturnAM
250
+ ? "AM"
251
+ : ""}
252
+ </span>
253
+ ) : (
254
+ <span>{DateService.formatTime(droppingTime)}</span>
255
+ )
83
256
  ) : null}
257
+ {/* {droppingTime ? (
258
+ <span>{DateService.formatTime(droppingTime)}</span>
259
+ ) : null} */}
84
260
  </div>
85
261
  </div>
86
262
 
@@ -158,7 +334,136 @@ const PaymentSideBarDesktop: React.FC<PaymentSideBarProps> = ({
158
334
  creditosLabel,
159
335
  currency,
160
336
  customSideBarwidth,
337
+ isLinatal,
161
338
  }) => {
339
+ // REMOVED AM/PM DUPLICATION AND ADDED 24 HOUR TIME FORMAT IN BOARDING STAGE
340
+ const depTime = droppingTimeOnward || "";
341
+ const returnTime = droppingTimeReturn || "";
342
+
343
+ const hasAM = depTime.includes("AM");
344
+ const hasPM = depTime.includes("PM");
345
+ const [timePart] = depTime.split(/AM|PM/).map((part) => part.trim());
346
+ const [hour, minute] = timePart.split(":").map(Number);
347
+
348
+ let cleanedDepTime;
349
+ if (hasAM) {
350
+ cleanedDepTime =
351
+ hour === 12
352
+ ? `00:${minute < 10 ? "0" + minute : minute}`
353
+ : `${hour < 10 ? "0" + hour : hour}:${
354
+ minute < 10 ? "0" + minute : minute
355
+ }`;
356
+ } else if (hasPM) {
357
+ cleanedDepTime =
358
+ hour === 12
359
+ ? `${hour}:${minute < 10 ? "0" + minute : minute}`
360
+ : `${hour + 12}:${minute < 10 ? "0" + minute : minute}`;
361
+ } else {
362
+ cleanedDepTime = timePart;
363
+ console.log("🚀 ~ cleanedDepTime:", cleanedDepTime);
364
+ }
365
+
366
+ let cleanBoardingReturnTime;
367
+ const hasBoardingReturnAM = returnTime.includes("AM");
368
+ const hasBoardingReturnPM = returnTime.includes("PM");
369
+ const [returnTimePart] = returnTime.split(/AM|PM/).map((part) => part.trim());
370
+ const [droppingReturnHour, returnMinute] = returnTimePart
371
+ .split(":")
372
+ .map(Number);
373
+
374
+ if (returnTime) {
375
+ if (hasBoardingReturnAM) {
376
+ cleanBoardingReturnTime =
377
+ droppingReturnHour === 12
378
+ ? `00:${returnMinute < 10 ? "0" + returnMinute : returnMinute}`
379
+ : `${
380
+ droppingReturnHour < 10
381
+ ? "0" + droppingReturnHour
382
+ : droppingReturnHour
383
+ }:${returnMinute < 10 ? "0" + returnMinute : returnMinute}`;
384
+ } else if (hasBoardingReturnPM) {
385
+ cleanBoardingReturnTime =
386
+ droppingReturnHour === 12
387
+ ? `${droppingReturnHour}:${
388
+ returnMinute < 10 ? "0" + returnMinute : returnMinute
389
+ }`
390
+ : `${droppingReturnHour + 12}:${
391
+ returnMinute < 10 ? "0" + returnMinute : returnMinute
392
+ }`;
393
+ } else {
394
+ cleanBoardingReturnTime = returnTimePart;
395
+ }
396
+
397
+ console.log("🚀 ~ cleanBoardingReturnTime:", cleanBoardingReturnTime);
398
+ }
399
+
400
+ // REMOVED AM/PM DUPLICATION AND ADDED 24 HOUR TIME FORMAT IN DROPPING STAGE
401
+ const dropdDepTime = droppingTimeOnward || "";
402
+ const dropReturnTime = droppingTimeReturn || "";
403
+
404
+ const dropHasAM = dropdDepTime.includes("AM");
405
+ const dropHasPM = dropdDepTime.includes("PM");
406
+ const [timePartDrop] = dropdDepTime.split(/AM|PM/).map((part) => part.trim());
407
+ const [hourDrop, minuteDrop] = timePartDrop.split(":").map(Number);
408
+ let cleanedDropDepTime = "";
409
+
410
+ if (dropHasAM) {
411
+ cleanedDropDepTime =
412
+ hourDrop === 12
413
+ ? `00:${minuteDrop < 10 ? "0" + minuteDrop : minuteDrop}`
414
+ : `${hourDrop < 10 ? "0" + hourDrop : hourDrop}:${
415
+ minuteDrop < 10 ? "0" + minuteDrop : minuteDrop
416
+ }`;
417
+ } else if (dropHasPM) {
418
+ cleanedDropDepTime =
419
+ hourDrop === 12
420
+ ? `${hourDrop}:${minuteDrop < 10 ? "0" + minuteDrop : minuteDrop}`
421
+ : `${hourDrop + 12}:${minuteDrop < 10 ? "0" + minuteDrop : minuteDrop}`;
422
+ } else {
423
+ cleanedDropDepTime = timePartDrop;
424
+ }
425
+
426
+ let cleanDroppingReturnTime;
427
+ const hasDroppingReturnAM = dropReturnTime.includes("AM");
428
+ const hasDroppingReturnPM = dropReturnTime.includes("PM");
429
+ const [droppingReturnTimePart] = dropReturnTime
430
+ .split(/AM|PM/)
431
+ .map((part) => part.trim());
432
+ const [returnHour, droppingReturnMinute] = droppingReturnTimePart
433
+ .split(":")
434
+ .map(Number);
435
+
436
+ if (returnTime) {
437
+ if (hasDroppingReturnAM) {
438
+ cleanDroppingReturnTime =
439
+ returnHour === 12
440
+ ? `00:${
441
+ droppingReturnMinute < 10
442
+ ? "0" + droppingReturnMinute
443
+ : droppingReturnMinute
444
+ }`
445
+ : `${returnHour < 10 ? "0" + returnHour : returnHour}:${
446
+ droppingReturnMinute < 10
447
+ ? "0" + droppingReturnMinute
448
+ : droppingReturnMinute
449
+ }`;
450
+ } else if (hasDroppingReturnPM) {
451
+ cleanDroppingReturnTime =
452
+ returnHour === 12
453
+ ? `${returnHour}:${
454
+ droppingReturnMinute < 10
455
+ ? "0" + droppingReturnMinute
456
+ : droppingReturnMinute
457
+ }`
458
+ : `${returnHour + 12}:${
459
+ droppingReturnMinute < 10
460
+ ? "0" + droppingReturnMinute
461
+ : droppingReturnMinute
462
+ }`;
463
+ } else {
464
+ cleanDroppingReturnTime = returnTimePart;
465
+ }
466
+ }
162
467
  return (
163
468
  <div className="">
164
469
  <div
@@ -237,6 +542,10 @@ const PaymentSideBarDesktop: React.FC<PaymentSideBarProps> = ({
237
542
  trainType: trainTypeOnward,
238
543
  isTrain: trainType,
239
544
  icons: icons,
545
+ journeyTypeActive: journeyTypeActive,
546
+ cleanedTime: cleanedDepTime,
547
+ cleanBoardingTime: null,
548
+ isLinatal: isLinatal,
240
549
  })
241
550
  : renderSummaryDetailsCard({
242
551
  serviceName: serviceNameReturn,
@@ -251,6 +560,10 @@ const PaymentSideBarDesktop: React.FC<PaymentSideBarProps> = ({
251
560
  trainType: trainTypeReturn,
252
561
  isTrain: trainType,
253
562
  icons: icons,
563
+ journeyTypeActive: journeyTypeActive,
564
+ cleanedTime: null,
565
+ cleanBoardingTime: cleanBoardingReturnTime,
566
+ isLinatal: isLinatal,
254
567
  })}
255
568
  </div>
256
569
 
@@ -99,5 +99,6 @@ export interface PaymentSideBarProps {
99
99
  creditosLabel?: string;
100
100
  walletLabel?: string;
101
101
  customSideBarwidth?: string;
102
+ isLinatal?: boolean;
102
103
  }
103
104
 
@@ -32,8 +32,11 @@ function ServiceItemPB({
32
32
  isPeruSites,
33
33
  showAvailableSeats,
34
34
  isSeatIcon,
35
+ isLinatal,
35
36
  t = (key: string) => key,
36
37
  }: ServiceItemProps & { currencySign?: string }): React.ReactElement {
38
+ console.log("🚀 ~ ServiceItemPB ~ isLinatal:", isLinatal);
39
+
37
40
  const SvgAmenities = ({
38
41
  moreAnemities,
39
42
  name,
@@ -523,6 +526,32 @@ function ServiceItemPB({
523
526
  onBookButtonPress();
524
527
  };
525
528
 
529
+ const depTime = serviceItem.dep_time || "";
530
+
531
+ // Extract hours and minutes and check for AM/PM
532
+ const hasAM = depTime.includes("AM");
533
+ const hasPM = depTime.includes("PM");
534
+ const [timePart] = depTime.split(/AM|PM/).map((part) => part.trim());
535
+ const [hour, minute] = timePart.split(":").map(Number);
536
+
537
+ // Convert to 24-hour format
538
+ let cleanedDepTime;
539
+ if (hasAM) {
540
+ cleanedDepTime =
541
+ hour === 12
542
+ ? `00:${minute < 10 ? "0" + minute : minute}`
543
+ : `${hour < 10 ? "0" + hour : hour}:${
544
+ minute < 10 ? "0" + minute : minute
545
+ }`;
546
+ } else if (hasPM) {
547
+ cleanedDepTime =
548
+ hour === 12
549
+ ? `${hour}:${minute < 10 ? "0" + minute : minute}`
550
+ : `${hour + 12}:${minute < 10 ? "0" + minute : minute}`;
551
+ } else {
552
+ cleanedDepTime = timePart;
553
+ }
554
+
526
555
  return (
527
556
  <>
528
557
  {isPeruSites ? (
@@ -768,9 +797,24 @@ function ServiceItemPB({
768
797
  <div className="flex flex-col gap-[10px]">
769
798
  {/* Departure Time */}
770
799
  <div className="h-[20px] flex items-center group relative">
771
- <div className="font-[900] bold-text">
772
- {DateService.formatTime(serviceItem.dep_time)}
773
- </div>
800
+ {isLinatal ? (
801
+ <div className="font-[900] bold-text">
802
+ <span>
803
+ {" "}
804
+ {cleanedDepTime}{" "}
805
+ <span>{hasPM ? "PM" : hasAM ? "AM" : ""}</span>
806
+ </span>
807
+
808
+ {serviceItem?.dep_time.includes("AM") ||
809
+ serviceItem?.dep_time.includes("PM")
810
+ ? null
811
+ : DateService.ampmOnly(serviceItem.dep_time)}
812
+ </div>
813
+ ) : (
814
+ <div className="font-[900] bold-text">
815
+ {DateService.formatTime(serviceItem.dep_time)}
816
+ </div>
817
+ )}
774
818
  {serviceItem.boarding_stages && (
775
819
  <div
776
820
  className="hidden group-hover:block absolute -top-[8px] left-[100%] ml-[25px] text-white px-3 py-2 rounded-[10px] whitespace-nowrap z-10 shadow-service"
@@ -1176,12 +1220,8 @@ function ServiceItemPB({
1176
1220
  {metaData &&
1177
1221
  serviceItem.operator_details[4]?.map(
1178
1222
  (val, key) => {
1179
- const exceptions = [
1180
- 1, 2, 5, 7, 8, 9, 12, 13, 14, 15,
1181
- ];
1182
- return exceptions.includes(
1183
- key
1184
- ) ? null : key >= 3 &&
1223
+ // Show all amenities with index 3 or higher, excluding WATER
1224
+ return key >= 3 &&
1185
1225
  metaData.amenities[val]
1186
1226
  ?.split(".")[0]
1187
1227
  ?.toUpperCase() !== "WATER" ? (
@@ -175,5 +175,6 @@ export interface ServiceItemProps {
175
175
  isPeruSites?: boolean;
176
176
  showAvailableSeats?: boolean;
177
177
  isSeatIcon?: boolean;
178
+ isLinatal?: boolean;
178
179
 
179
180
  }
@@ -44,6 +44,13 @@ const DateService = {
44
44
  return type === "half" ? days[day] : fullDays[day];
45
45
  },
46
46
 
47
+ ampmOnly: (time) => {
48
+ if (time < "12:00") {
49
+ return "AM";
50
+ }
51
+ return "PM";
52
+ },
53
+
47
54
  getMonthName: (month: number, type = "half"): string => {
48
55
  const months = [
49
56
  "ene",