Skip to content
Snippets Groups Projects

Issue #3353799: Wrong count with future range

1 file
+ 3
1
Compare changes
  • Side-by-side
  • Inline
@@ -103,7 +103,9 @@ class SearchApiRelativeDate extends QueryTypeRangeBase {
foreach ($facetResults as $facetResult) {
$facetDate = DrupalDateTime::createFromTimestamp(strtotime($facetResult->getRawValue()));
if ($facetDate <= $fieldDate && $fieldDate <= $this->currentTime) {
if (($facetDate <= $fieldDate && $fieldDate <= $this->currentTime)
|| ($facetDate >= $fieldDate && $fieldDate >= $this->currentTime)
) {
$newCount = $facetResult->getCount() + $count;
$facetResult->setCount($newCount);
}
Loading