diff --git a/src/app/groups/[groupId]/expenses/expense-list.tsx b/src/app/groups/[groupId]/expenses/expense-list.tsx index cc908af..299f735 100644 --- a/src/app/groups/[groupId]/expenses/expense-list.tsx +++ b/src/app/groups/[groupId]/expenses/expense-list.tsx @@ -19,6 +19,7 @@ type Props = { } const EXPENSE_GROUPS = { + UPCOMING: 'Upcoming', THIS_WEEK: 'This week', EARLIER_THIS_MONTH: 'Earlier this month', LAST_MONTH: 'Last month', @@ -28,7 +29,9 @@ const EXPENSE_GROUPS = { } function getExpenseGroup(date: Dayjs, today: Dayjs) { - if (today.isSame(date, 'week')) { + if (today.isBefore(date)) { + return EXPENSE_GROUPS.UPCOMING + } else if (today.isSame(date, 'week')) { return EXPENSE_GROUPS.THIS_WEEK } else if (today.isSame(date, 'month')) { return EXPENSE_GROUPS.EARLIER_THIS_MONTH