Merge pull request #317 from R0m1k3/1.1

Correctly calculate the number of days pending for orders
This commit is contained in:
LogiFlow authored and GitHub committed 2025-09-02 10:52:51 +02:00
commit 687d7082e9
2 files changed
+2 -2

No files matched your search

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

+2 -2
View File
@@ -447,8 +447,8 @@ export default function Dashboard() {
</CardHeader>
<CardContent className="space-y-3 p-6 max-h-96 overflow-y-auto">
{pendingOrders.length > 0 ? pendingOrders.map((order: any) => {
// Calculer le nombre de jours en attente
const orderDate = safeDate(order.createdAt);
// Calculer le nombre de jours en attente depuis la date prévue
const orderDate = safeDate(order.plannedDate);
const daysPending = orderDate ? Math.floor((new Date().getTime() - orderDate.getTime()) / (1000 * 60 * 60 * 24)) : 0;
const isOverdue = daysPending > 10;