mirror of
https://github.com/spliit-app/spliit.git
synced 2026-02-27 18:06:12 +01:00
Fix how dates are displayed (Fix #33)
This commit is contained in:
@@ -29,7 +29,7 @@ export function ExpenseList({
|
|||||||
<div
|
<div
|
||||||
key={expense.id}
|
key={expense.id}
|
||||||
className={cn(
|
className={cn(
|
||||||
'border-t flex justify-between pl-6 pr-2 py-4 text-sm cursor-pointer hover:bg-accent',
|
'border-t flex justify-between pl-6 pr-2 py-4 text-sm cursor-pointer hover:bg-accent gap-1',
|
||||||
expense.isReimbursement && 'italic',
|
expense.isReimbursement && 'italic',
|
||||||
)}
|
)}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
@@ -42,10 +42,7 @@ export function ExpenseList({
|
|||||||
</div>
|
</div>
|
||||||
<div className="text-xs text-muted-foreground">
|
<div className="text-xs text-muted-foreground">
|
||||||
Paid by <strong>{getParticipant(expense.paidById)?.name}</strong> on{' '}
|
Paid by <strong>{getParticipant(expense.paidById)?.name}</strong> on{' '}
|
||||||
{expense.expenseDate.toLocaleDateString('en-US', {
|
{formatDate(expense.expenseDate)} for{' '}
|
||||||
dateStyle: 'medium',
|
|
||||||
})}{' '}
|
|
||||||
for{' '}
|
|
||||||
{expense.paidFor.map((paidFor, index) => (
|
{expense.paidFor.map((paidFor, index) => (
|
||||||
<Fragment key={index}>
|
<Fragment key={index}>
|
||||||
{index !== 0 && <>, </>}
|
{index !== 0 && <>, </>}
|
||||||
@@ -87,3 +84,10 @@ export function ExpenseList({
|
|||||||
</p>
|
</p>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function formatDate(date: Date) {
|
||||||
|
return date.toLocaleDateString('en-US', {
|
||||||
|
dateStyle: 'medium',
|
||||||
|
timeZone: 'UTC',
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user