Skip to content

Commit

Permalink
fix: events scheduled for today's date not showing today
Browse files Browse the repository at this point in the history
  • Loading branch information
alaa-yahia committed Oct 23, 2024
1 parent 6970f44 commit e7d852f
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,14 @@ const getEventStatus = (event: ApiEnrollmentEvent) => {
}

if (event.status === statusTypes.SCHEDULE) {
if (!event.scheduledAt || !daysUntilDueDate) {
if (!event.scheduledAt) {
return { status: statusTypes.SCHEDULE, options: undefined };
}

if (daysUntilDueDate === 0) {
return { status: statusTypes.SCHEDULE, options: 'today' };
}

if (daysUntilDueDate < 14) {
return { status: statusTypes.SCHEDULE, options: dueDateFromNow };
}
Expand Down

0 comments on commit e7d852f

Please sign in to comment.