summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/lib/tempo/components/Tempo.jsx9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/lib/tempo/components/Tempo.jsx b/src/lib/tempo/components/Tempo.jsx
index ef516c64..7d9ede7d 100644
--- a/src/lib/tempo/components/Tempo.jsx
+++ b/src/lib/tempo/components/Tempo.jsx
@@ -83,6 +83,11 @@ const Tempo = () => {
};
const startItem = 1 + (pageNew - 1) * limitNew;
const endItem = Math.min(limitNew * pageNew, invoices?.data?.invoiceTotal);
+ const getDueDate = (invoice) => {
+ const [day, month, year] = invoice.split('/');
+ const dueDate = new Date(year, month - 1, day); // Konversi ke objek Date
+ return dueDate;
+ };
return (
<>
<DesktopView>
@@ -227,7 +232,9 @@ const Tempo = () => {
<td>
{invoice.amountResidual > 0 ? (
<div className='badge-solid-red h-fit mx-auto'>
- Belum Lunas
+ {new Date() > getDueDate(invoice.invoiceDateDue)
+ ? 'Jatuh Tempo'
+ : 'Belum Lunas'}
</div>
) : (
<div className='badge-solid-green h-fit mx-auto'>