Skip to content

Expense list displays the expense createdAt date instead of expenseDate #17

Description

@jesseahouser

Mobile app behavior

The mobile app Expense list always displays the createdAt date. If a user has entered an expenseDate for a given expense, the expectation from the user is to see expenseDate displayed in the list rather than the createdAt date.

<Text className="text-xs text-slate-600">
{expense.createdAt.toLocaleDateString('en-US', {
dateStyle: 'medium',
})}
</Text>

Web app behavior

The web app correctly displays the expenseDate.
https://github.com/spliit-app/spliit-web/blob/5c9002e15ce0bcfb7d8efda7a4d348f89e29ff83/src/app/groups/%5BgroupId%5D/expenses/expense-list.tsx#L51-L59

function getGroupedExpensesByDate(expenses: ExpensesType) {
  const today = dayjs()
  return expenses.reduce((result: { [key: string]: ExpensesType }, expense) => {
    const expenseGroup = getExpenseGroup(dayjs(expense.expenseDate), today)
    result[expenseGroup] = result[expenseGroup] ?? []
    result[expenseGroup].push(expense)
    return result
  }, {})
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions