Skip to content

Commit

Permalink
Merge pull request #171 from Holo-Host/fix-invoice-details-date
Browse files Browse the repository at this point in the history
Fix/invoice details due date
  • Loading branch information
mateuszRybczonek authored Aug 23, 2024
2 parents 5ac699a + ac56b02 commit 8dd1f4e
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/pages/InvoicesPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -130,14 +130,12 @@ const invoices = computed(() => {
return Array.isArray(rawInvoices)
? rawInvoices.map((invoice) => {
const note = JSON.parse(invoice.note);
const expirationDate = note['invoice_due_date'] ? new Date(note['invoice_due_date'] * 1_000) : 'N/A';
return {
...invoice,
formattedId: `...${invoice.id.substring(invoice.id.length - kVisibleHashLength)}`,
happ: invoice.happ.name,
formattedExpirationDate: expirationDate
? dayjs(expirationDate).format(kDefaultDateFormat)
formattedExpirationDate: invoice.invoiceDetails.end
? dayjs(invoice.invoiceDetails.end / 1000).format(kDefaultDateFormat)
: '-',
amount: Number(invoice.amount),
formattedCompletedDate: dayjs(invoice.completedDate / kMsInSecond).format(
Expand Down

0 comments on commit 8dd1f4e

Please sign in to comment.