mirror of
https://github.com/R0m1k3/LogiFlow.git
synced 2026-10-11 17:27:31 +02:00
Update logic to only show button for expired products
Modify DlcPage.tsx to change the condition for displaying a button, now requiring product expiry date to be strictly less than the current date. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 1e4433b5-47ab-464c-b663-fea2e53367dd Replit-Commit-Checkpoint-Type: intermediate_checkpoint Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/1e4433b5-47ab-464c-b663-fea2e53367dd/GMJhCAQ
This commit is contained in:
1 parent
4210ba7602
commit
8272db755b
1 file changed
+2
-2
@@ -367,9 +367,9 @@ export default function DlcPage() {
|
||||
const expiry = new Date(product.expiryDate || new Date());
|
||||
const daysUntilExpiry = Math.ceil((expiry.getTime() - today.getTime()) / (1000 * 60 * 60 * 24));
|
||||
|
||||
// Afficher le bouton si le produit expire dans 15 jours ou moins, ou est déjà expiré
|
||||
// Afficher le bouton SEULEMENT pour les produits EXPIRÉS (pas ceux qui expirent bientôt)
|
||||
// ET si le produit n'est pas déjà validé
|
||||
return (daysUntilExpiry <= 15 && product.status !== "valides");
|
||||
return (daysUntilExpiry < 0 && product.status !== "valides");
|
||||
};
|
||||
|
||||
// Fonction pour déterminer si un produit doit afficher le bouton "Marquer comme traité"
|
||||
|
||||
Reference in new issue
Block a user