mirror of
https://github.com/spliit-app/spliit.git
synced 2026-02-08 08:36:12 +01:00
Expense list: add section for planned purchases (#122)
* add planned purchases * Updating verbiage to reflect possible future entry types
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user