Create expense from receipt (#69)

* Create expense from receipt

* Add modal

* Update README
This commit is contained in:
Sebastien Castiel
2024-01-30 16:36:29 -05:00
committed by GitHub
parent 9e300e0ff0
commit 4a9bf575bd
10 changed files with 657 additions and 518 deletions

View File

@@ -3,7 +3,7 @@ import { CategoryIcon } from '@/app/groups/[groupId]/expenses/category-icon'
import { Button } from '@/components/ui/button'
import { SearchBar } from '@/components/ui/search-bar'
import { getGroupExpenses } from '@/lib/api'
import { cn } from '@/lib/utils'
import { cn, formatExpenseDate } from '@/lib/utils'
import { Expense, Participant } from '@prisma/client'
import dayjs, { type Dayjs } from 'dayjs'
import { ChevronRight } from 'lucide-react'
@@ -159,7 +159,7 @@ export function ExpenseList({
{currency} {(expense.amount / 100).toFixed(2)}
</div>
<div className="text-xs text-muted-foreground">
{formatDate(expense.expenseDate)}
{formatExpenseDate(expense.expenseDate)}
</div>
</div>
<Button
@@ -189,10 +189,3 @@ export function ExpenseList({
</p>
)
}
function formatDate(date: Date) {
return date.toLocaleDateString('en-US', {
dateStyle: 'medium',
timeZone: 'UTC',
})
}