From 944f4dc43bdfe056e75ef7e107a1a77a4111bf8a Mon Sep 17 00:00:00 2001 From: Udit Takkar <53316345+Udit-takkar@users.noreply.github.com> Date: Sat, 27 Aug 2022 18:42:38 +0530 Subject: [PATCH] fix: pass recurring count value (#3844) * fix: pass recurring count value * fix: show dates for pending booking Co-authored-by: Peer Richelsen Co-authored-by: Leo Giovanetti --- apps/web/components/booking/BookingListItem.tsx | 7 +------ apps/web/pages/success.tsx | 6 +++++- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/apps/web/components/booking/BookingListItem.tsx b/apps/web/components/booking/BookingListItem.tsx index 6a76256174..283f1fc015 100644 --- a/apps/web/components/booking/BookingListItem.tsx +++ b/apps/web/components/booking/BookingListItem.tsx @@ -181,18 +181,13 @@ function BookingListItem(booking: BookingItemProps) { // Calculate the booking date(s) and setup recurring event data to show let recurringStrings: string[] = []; let recurringDates: Date[] = []; - const today = new Date(); + if (booking.recurringBookings && booking.eventType.recurringEvent?.freq !== undefined) { [recurringStrings, recurringDates] = extractRecurringDates( booking.recurringBookings, user?.timeZone, i18n ); - if (booking.status === BookingStatus.PENDING) { - // Only take into consideration next up instances if booking is confirmed - recurringDates = recurringDates.filter((aDate) => aDate >= today); - recurringStrings = recurringDates.map((_, key) => recurringStrings[key]); - } } const location = booking.location || ""; diff --git a/apps/web/pages/success.tsx b/apps/web/pages/success.tsx index 5b2037fe7e..070224ac9d 100644 --- a/apps/web/pages/success.tsx +++ b/apps/web/pages/success.tsx @@ -608,7 +608,11 @@ export function RecurringBookings({ <> {eventType.recurringEvent?.count && ( - {getEveryFreqFor({ t, recurringEvent: eventType.recurringEvent })} + {getEveryFreqFor({ + t, + recurringEvent: eventType.recurringEvent, + recurringCount: recurringBookings?.length ?? undefined, + })} )} {eventType.recurringEvent?.count &&