diff options
| author | it-fixcomart <it@fixcomart.co.id> | 2024-11-15 15:21:21 +0700 |
|---|---|---|
| committer | it-fixcomart <it@fixcomart.co.id> | 2024-11-15 15:21:21 +0700 |
| commit | f906429778e932e2cdbdee05492e697a090a469c (patch) | |
| tree | cf090cc761048ecb99f409caab0124dfcace5ae8 | |
| parent | cf92e065f057737071e6cd7c666a4f1c475bb613 (diff) | |
<iman> update code
| -rw-r--r-- | src/lib/tempo/components/Tempo.jsx | 9 |
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'> |
