From 03a22132e430adc43845da9a6b5f2dacbeafd311 Mon Sep 17 00:00:00 2001 From: Kamil Date: Thu, 19 Jul 2018 21:22:21 +0200 Subject: Add search within a range of dates for completion and modification --- app/Filter/BaseDateRangeFilter.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'app/Filter/BaseDateRangeFilter.php') diff --git a/app/Filter/BaseDateRangeFilter.php b/app/Filter/BaseDateRangeFilter.php index 336f8c8e..fcff0d4c 100644 --- a/app/Filter/BaseDateRangeFilter.php +++ b/app/Filter/BaseDateRangeFilter.php @@ -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); -- cgit v1.2.3