Skip to content

Commit

Permalink
fix: add releaseDate to partner card (bloom-housing#4315)
Browse files Browse the repository at this point in the history
* fix: complete todo

* fix: findLast alternative
  • Loading branch information
ColinBuyck authored and emilyjablonski committed Sep 13, 2024
1 parent 2bc3bed commit 9c5b138
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions sites/partners/src/pages/listings/[id]/lottery.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,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 (
<CardSection>
<Icon size="xl">
Expand All @@ -212,8 +216,8 @@ const Lottery = (props: { listing: Listing | undefined }) => {
<p>
{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"),
})}
</p>
Expand Down

0 comments on commit 9c5b138

Please sign in to comment.