From a6ef7b5ab8f6135b6ce9e0300d14a41d59e9859a Mon Sep 17 00:00:00 2001
From: Christophe Brazier <christophe.brazier@openbravo.com>
Date: Mon, 8 Feb 2021 09:41:16 +0100
Subject: [PATCH] =?UTF-8?q?NOE-2793=20Probl=C3=A8me=20d'activation=20des?=
 =?UTF-8?q?=20OTF?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 web/org.openbravo.retail.discounts.coupons.otf/js/utils.js | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/web/org.openbravo.retail.discounts.coupons.otf/js/utils.js b/web/org.openbravo.retail.discounts.coupons.otf/js/utils.js
index ebed003..eb11290 100644
--- a/web/org.openbravo.retail.discounts.coupons.otf/js/utils.js
+++ b/web/org.openbravo.retail.discounts.coupons.otf/js/utils.js
@@ -465,9 +465,7 @@
 
       let getCouponRule = async function(callback) {
         const couponRules = [];
-        const now = new Date();
-        // set time to beginning of the day so that OTF rules that start or end today are both accepted
-        now.setHours(0, 0, 0, 0);
+        const now = new Date(new Date().toISOString().split('T')[0]);
         try {
           const criteria = new OB.App.Class.Criteria()
             .orderBy('searchKey', 'asc')
-- 
GitLab

