<?php
 namespace ModStart\Grid\Filter; class DatetimeRange extends AbstractFilter { public function condition($searchInfo) { if (isset($searchInfo['datetimeRange']) && ($searchInfo['datetimeRange']['min'] || $searchInfo['datetimeRange']['max'])) { $value = $searchInfo['datetimeRange']; if (!isset($value['min'])) { return $this->buildCondition($this->column, '<=', $value['max']); } if (!isset($value['max'])) { return $this->buildCondition($this->column, '>=', $value['min']); } $this->query = 'whereBetween'; return $this->buildCondition($this->column, [$value['min'], $value['max']]); } return null; } } 