Add search within a range of dates for completion and modification

This commit is contained in:
Kamil
2018-07-19 21:22:21 +02:00
committed by Frédéric Guillot
parent fe935d6ec1
commit 03a22132e4
6 changed files with 92 additions and 4 deletions

View File

@@ -42,10 +42,10 @@ abstract class BaseDateRangeFilter extends BaseFilter
protected function applyDateFilter($field)
{
$dates = explode('..', $this->value);
if(count($dates)=== 2){
$timestampFrom = $this->dateParser->getTimestamp($dates[0]);
$timestampTo = $this->dateParser->getTimestamp($dates[1]);
if(count($dates)=== 2){
$timestampFrom = $this->dateParser->getTimestamp($dates[0]." 00:00");
$timestampTo = $this->dateParser->getTimestamp($dates[1]." 00:00");
$this->query->gte($field, $timestampFrom);
$this->query->lte($field, $timestampTo + 86399);