Skip to content

Commit 626246c

Browse files
author
Smef
authored
Merge pull request #28
Update where date to allow for different operators
2 parents b6ea479 + dec86da commit 626246c

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/Database/Query/FMBaseBuilder.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -788,9 +788,13 @@ public function count($columns = '*')
788788

789789
public function whereDate($column, $operator, $value = null, $boolean = 'and')
790790
{
791+
if (is_null($value)) {
792+
$value = $operator;
793+
$operator = '=';
794+
}
791795

792-
if ($operator instanceof DateTimeInterface) {
793-
$operator = $operator->format('n/j/Y');
796+
if ($value instanceof DateTimeInterface) {
797+
$value = $value->format('n/j/Y');
794798
}
795799

796800
return $this->where($column, $operator, $value, $boolean);

0 commit comments

Comments
 (0)