mirror of
https://github.com/spliit-app/spliit.git
synced 2026-03-02 19:26:11 +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 = {
|
const EXPENSE_GROUPS = {
|
||||||
|
UPCOMING: 'Upcoming',
|
||||||
THIS_WEEK: 'This week',
|
THIS_WEEK: 'This week',
|
||||||
EARLIER_THIS_MONTH: 'Earlier this month',
|
EARLIER_THIS_MONTH: 'Earlier this month',
|
||||||
LAST_MONTH: 'Last month',
|
LAST_MONTH: 'Last month',
|
||||||
@@ -28,7 +29,9 @@ const EXPENSE_GROUPS = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function getExpenseGroup(date: Dayjs, today: Dayjs) {
|
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
|
return EXPENSE_GROUPS.THIS_WEEK
|
||||||
} else if (today.isSame(date, 'month')) {
|
} else if (today.isSame(date, 'month')) {
|
||||||
return EXPENSE_GROUPS.EARLIER_THIS_MONTH
|
return EXPENSE_GROUPS.EARLIER_THIS_MONTH
|
||||||
|
|||||||
Reference in New Issue
Block a user