From 157704fa4723bead2a1ddda1c51cfac9225b4ed0 Mon Sep 17 00:00:00 2001 From: ColinBuyck <53269332+ColinBuyck@users.noreply.github.com> Date: Thu, 12 Sep 2024 17:41:37 -0700 Subject: [PATCH] fix: add releaseDate to partner card (#4315) * fix: complete todo * fix: findLast alternative --- sites/partners/src/pages/listings/[id]/lottery.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sites/partners/src/pages/listings/[id]/lottery.tsx b/sites/partners/src/pages/listings/[id]/lottery.tsx index ef1b53b779..d76e5f757b 100644 --- a/sites/partners/src/pages/listings/[id]/lottery.tsx +++ b/sites/partners/src/pages/listings/[id]/lottery.tsx @@ -198,6 +198,10 @@ const Lottery = (props: { listing: Listing | undefined }) => { (event) => event.type === ListingEventsTypeEnum.publicLottery ) if (listing.lotteryStatus === LotteryStatusEnum.releasedToPartners) { + // reverse array to find most recent release date + const lotteryReleaseDate = lotteryActivityLogData + ?.reverse() + ?.find((logItem) => logItem.status === LotteryStatusEnum.releasedToPartners)?.logDate return ( @@ -211,8 +215,8 @@ const Lottery = (props: { listing: Listing | undefined }) => {

{t("listings.lottery.partnerPublishTimestamp", { adminName: t("listings.lottery.partnerPublishTimestampAdmin"), - date: "DATE", - time: "TIME", + date: dayjs(lotteryReleaseDate).format("MM/DD/YYYY"), + time: dayjs(lotteryReleaseDate).format("h:mm a"), portal: t("listings.lottery.partnerPublishTimestampPortal"), })}