Skip to content

Commit

Permalink
🚀 Add group created date and first expense date (#141)
Browse files Browse the repository at this point in the history
* Add group created date and first expense date

* Fixup
  • Loading branch information
alexanderwassbjer authored Nov 1, 2024
1 parent 67741b8 commit c472b47
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions src/pages/groups/[groupId].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,19 @@ const BalancePage: NextPageWithUser<{
) : null;
})}
</div>
{expensesQuery?.data && expensesQuery?.data?.length > 0 && (
<div className="mt-8">
<p className="font-semibold">First expense</p>
<p>
{format(
new Date(
expensesQuery.data[expensesQuery.data.length - 1]?.createdAt ?? '',
).toLocaleDateString(),
'yyyy-MM-dd',
)}
</p>
</div>
)}
</div>
</AppDrawer>
<AppDrawer
Expand All @@ -184,6 +197,17 @@ const BalancePage: NextPageWithUser<{
))}
</div>
</div>
{groupDetailQuery?.data?.createdAt && (
<div className="mt-8">
<p className="font-semibold ">Group created</p>
<p>
{format(
new Date(groupDetailQuery.data?.createdAt).toLocaleDateString(),
'yyyy-MM-dd',
)}
</p>
</div>
)}
<div className="mt-8">
<p className="font-semibold ">Actions</p>
<div className="mt-2 flex flex-col gap-1">
Expand Down

0 comments on commit c472b47

Please sign in to comment.