Skip to content

Commit

Permalink
fix: use correct lottery time
Browse files Browse the repository at this point in the history
  • Loading branch information
ludtkemorgan committed Jan 9, 2025
1 parent 87e445b commit 30ecde4
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
3 changes: 2 additions & 1 deletion api/prisma/seed-helpers/translation-factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,8 @@ const translations = (jurisdictionName?: string, language?: LanguagesEnum) => {
rentalOpportunity: {
subject: 'New rental opportunity',
intro: 'Rental opportunity at',
viewListingNotice: 'Please view listing for the most updated information',
viewListingNotice:
'Please view listing for the most updated information',
applicationsDue: 'Applications Due',
community: 'Community',
address: 'Address',
Expand Down
14 changes: 11 additions & 3 deletions api/src/services/email.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -681,11 +681,19 @@ export class EmailService {
(event) => event.type === ListingEventsTypeEnum.publicLottery,
);
if (lotteryEvent && lotteryEvent.startDate) {
let lotteryDateTime = dayjs(lotteryEvent.startDate)
.tz(process.env.TIME_ZONE)
.format('MMMM D, YYYY');
if (lotteryEvent.startTime) {
lotteryDateTime =
lotteryDateTime +
`at ${dayjs(lotteryEvent.startTime)
.tz(process.env.TIME_ZONE)
.format('h:mma z')}`;
}
tableRows.push({
label: this.polyglot.t('rentalOpportunity.lottery'),
value: dayjs(lotteryEvent.startDate)
.tz(process.env.TIME_ZONE)
.format('MMMM D, YYYY [at] h:mma z'),
value: lotteryDateTime,
});
}
}
Expand Down

0 comments on commit 30ecde4

Please sign in to comment.