Fix wrong converted condition

The condition was changed when types where properly added.
The actual meaning was changed by accident and is now fixed again.
This commit is contained in:
Daniel Siepmann 2021-09-07 15:56:22 +02:00
parent 6226fb32d4
commit 26cc0d3f8c

View file

@ -61,14 +61,14 @@ class DateRepository extends Repository
$constraints['userCategories'] = $query->in('event.categories.uid', $demand->getUserCategories());
}
if ($demand->getStart() !== '') {
if ($demand->getStart() !== null) {
$constraints['starts'] = $query->greaterThanOrEqual('start', $demand->getStart());
}
if ($demand->getEnd() != '') {
if ($demand->getEnd() != null) {
$constraints['ends'] = $query->lessThanOrEqual('end', $demand->getEnd());
}
if ($demand->getStart() !== null && $demand->getEnd() !== null) {
if ($demand->getStart() === null && $demand->getEnd() === null) {
$now = new \DateTime('now', new \DateTimeZone('Europe/Berlin'));
$constraints['untilnow'] = $query->greaterThanOrEqual('start', $now);
}