Upgrade to Expo 57 and add parity smoke tests
This commit is contained in:
@@ -6,7 +6,13 @@ export function getInvoiceStatus(invoice: {
|
||||
}): InvoiceStatus {
|
||||
if (invoice.status === "paid") return "paid";
|
||||
if (invoice.status === "draft") return "draft";
|
||||
if (new Date(invoice.dueDate) < new Date()) return "overdue";
|
||||
|
||||
const today = new Date();
|
||||
const due = new Date(invoice.dueDate);
|
||||
today.setHours(0, 0, 0, 0);
|
||||
due.setHours(0, 0, 0, 0);
|
||||
|
||||
if (due < today) return "overdue";
|
||||
return "sent";
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user