Skip to content

Commit

Permalink
[BUGFIX] Fix range string calculation in DateRange facet
Browse files Browse the repository at this point in the history
This change fixes the range string calculation, so items for
the given date are included until 23:59 of the target end date.

Fixes: #4087
  • Loading branch information
derhansen authored and dkd-kaehm committed Jul 4, 2024
1 parent f4746c3 commit fef3dde
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public function __construct(
protected function getRangeString(): string
{
$from = $this->startRequested === null ? '' : $this->startRequested->format('Ymd') . '0000';
$till = $this->endRequested === null ? '' : $this->endRequested->format('Ymd') . '0000';
$till = $this->endRequested === null ? '' : $this->endRequested->format('Ymd') . '2359';
return $from . '-' . $till;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public function facetIsCreated(): void
self::assertSame($facet->getConfiguration(), $facetConfiguration['myCreated.'], 'Configuration was not passed to new facets');
self::assertTrue($facet->getIsUsed());

self::assertEquals('201506020000-201706020000', $facet->getRange()->getLabel());
self::assertEquals('201506020000-201706022359', $facet->getRange()->getLabel());
self::assertEquals(32, $facet->getRange()->getDocumentCount());
self::assertCount(3, $facet->getRange()->getRangeCounts(), 'We expected that there are three count items attached');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public function canHandleHalfOpenDateRanges(): void
$error->getMessage() . ' in ' . $error->getFile() . ':' . $error->getLine()
);
}
self::assertEquals('-202107200000', $dateRangeCollectionKeyOpenStart);
self::assertEquals('-202107202359', $dateRangeCollectionKeyOpenStart);
self::assertEquals('202107200000-', $dateRangeCollectionKeyOpenEnd);
}
}

0 comments on commit fef3dde

Please sign in to comment.