Skip to content

Commit

Permalink
postgres fix for #48
Browse files Browse the repository at this point in the history
  • Loading branch information
janhenckens committed Dec 16, 2024
1 parent eea7d1f commit c0745d7
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/behaviors/EntryQueryBehavior.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public function onAfterPrepare()
if ($field && $this->isFuture) {
$this->owner->subQuery
->andWhere(Db::parseDateParam(
'"field_' . $this->handle . $this->columnSuffix . '"::json->>\'start\'',
$field->getValueSql('start'),
date('Y-m-d'),
$this->includeToday ? '>=' : '>'
));
Expand All @@ -119,7 +119,7 @@ public function onAfterPrepare()
if ($field && $this->isPast) {
$this->owner->subQuery
->andWhere(Db::parseDateParam(
'"field_' . $this->handle . $this->columnSuffix . '"::json->>\'end\'',
$field->getValueSql('end'),
date('Y-m-d'),
$this->includeToday ? '<=' : '<'
));
Expand All @@ -128,7 +128,7 @@ public function onAfterPrepare()
if ($field && $this->isNotPast) {
$this->owner->subQuery
->andWhere(Db::parseDateParam(
'"field_' . $this->handle . $this->columnSuffix . '"::json->>\'end\'',
$field->getValueSql('end'),
date('Y-m-d'),
$this->includeToday ? '>=' : '>'
));
Expand All @@ -137,13 +137,13 @@ public function onAfterPrepare()
if ($field && $this->isOnGoing) {
$this->owner->subQuery
->andWhere(Db::parseDateParam(
'"field_' . $this->handle . $this->columnSuffix . '"::json->>\'start\'',
$field->getValueSql('start'),
date('Y-m-d'),
$this->includeToday ? '<=' : '<'
));
$this->owner->subQuery
->andWhere(Db::parseDateParam(
'"field_' . $this->handle . $this->columnSuffix . '"::json->>\'end\'',
$field->getValueSql('end'),
date('Y-m-d'),
$this->includeToday ? '>=' : '>'
));
Expand Down

0 comments on commit c0745d7

Please sign in to comment.