Add Expense Date (#26)

* add expense date

* Improve date formatting

* Prettier

* Change field description

---------

Co-authored-by: Sebastien Castiel <sebastien@castiel.me>
This commit is contained in:
Chris Johnston
2024-01-08 19:26:44 +00:00
committed by GitHub
parent 4566900f9c
commit bec1dd270a
8 changed files with 42 additions and 3 deletions

View File

@@ -41,7 +41,10 @@ export function ExpenseList({
{expense.title}
</div>
<div className="text-xs text-muted-foreground">
Paid by <strong>{getParticipant(expense.paidById)?.name}</strong>{' '}
Paid by <strong>{getParticipant(expense.paidById)?.name}</strong> on{' '}
{expense.expenseDate.toLocaleDateString('en-US', {
dateStyle: 'medium',
})}{' '}
for{' '}
{expense.paidFor.map((paidFor, index) => (
<Fragment key={index}>

View File

@@ -1,5 +1,5 @@
'use server'
import { getGroups } from "@/lib/api"
import { getGroups } from '@/lib/api'
export async function getGroupsAction(groupIds: string[]) {
'use server'