From 81413be34e079d37b2bf7673b043dfd079ccbf2d Mon Sep 17 00:00:00 2001 From: Romain Ruaud Date: Fri, 14 Jun 2024 15:52:17 +0200 Subject: [PATCH] Fix lte and gte cases for dates intervals --- .../Rule/Condition/Product/SpecialAttribute/ProductDate.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/module-elasticsuite-catalog-rule/Model/Rule/Condition/Product/SpecialAttribute/ProductDate.php b/src/module-elasticsuite-catalog-rule/Model/Rule/Condition/Product/SpecialAttribute/ProductDate.php index 030983d8f..9c4b9b346 100644 --- a/src/module-elasticsuite-catalog-rule/Model/Rule/Condition/Product/SpecialAttribute/ProductDate.php +++ b/src/module-elasticsuite-catalog-rule/Model/Rule/Condition/Product/SpecialAttribute/ProductDate.php @@ -105,10 +105,10 @@ public function getSearchQuery(ProductCondition $condition) $bounds['gt'] = $dateReference->format('Y-m-d'); break; case '>=': - $bounds['gte'] = $dateReference->format('Y-m-d'); + $bounds['lte'] = $dateReference->format('Y-m-d'); break; case '<=': - $bounds['lte'] = $dateReference->format('Y-m-d'); + $bounds['gte'] = $dateReference->format('Y-m-d'); break; default: throw new \InvalidArgumentException('Invalid operator');