yearMonth split into year + month
This commit is contained in:
@@ -11,7 +11,7 @@ export interface LocationCardProps {
|
||||
location: BillingLocation
|
||||
}
|
||||
|
||||
export const LocationCard:FC<LocationCardProps> = ({location: { _id, name, yearMonth, bills }}) => {
|
||||
export const LocationCard:FC<LocationCardProps> = ({location: { _id, name, year, month, bills }}) => {
|
||||
|
||||
// sum all the billAmounts
|
||||
const monthlyExpense = bills.reduce((acc, bill) => acc + (bill.payedAmount ?? 0), 0);
|
||||
@@ -22,7 +22,7 @@ export const LocationCard:FC<LocationCardProps> = ({location: { _id, name, yearM
|
||||
<a href={`/location/${_id}/edit`} className="card-subtitle tooltip" data-tip="Edit Location">
|
||||
<Cog8ToothIcon className="h-[1em] w-[1em] absolute cursor-pointer top-3 right-3 text-2xl" />
|
||||
</a>
|
||||
<h2 className="card-title">{formatYearMonth(yearMonth)} {name}</h2>
|
||||
<h2 className="card-title">{formatYearMonth(year, month)} {name}</h2>
|
||||
<div className="card-actions">
|
||||
{
|
||||
bills.map(bill => <BillBadge key={`${bill._id}`} locationId={_id} bill={bill} />)
|
||||
|
||||
Reference in New Issue
Block a user