Skip to content

Commit

Permalink
Merge pull request #177 from pravinTek/modifyDateFormat
Browse files Browse the repository at this point in the history
Task #176 chore: Compatible date field filter for any date format and modified in query
  • Loading branch information
vaivk369 authored Jan 22, 2020
2 parents 32f6eac + d6397ab commit 8b7442b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tjreports/site/models/reports.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
JLoader::import('database', JPATH_SITE . '/components/com_tjreports/helpers');
JLoader::import('components.com_tjreports.helpers.tjreports', JPATH_ADMINISTRATOR);

use Joomla\CMS\Date\Date;

/**
* Methods supporting a list of Tjreports records.
*
Expand Down Expand Up @@ -687,12 +689,14 @@ protected function getListQuery()
if (!empty($filters[$fromCol]))
{
$fromTime = $filters[$fromCol] . ' 00:00:00';
$fromTime = new Date($fromTime, 'UTC');
$query->where($dispFilter['searchin'] . ' >= ' . $db->quote($fromTime));
}

if (!empty($filters[$toCol]))
{
$toTime = $filters[$toCol] . ' 23:59:59';
$toTime = new Date($toTime, 'UTC');
$query->where($dispFilter['searchin'] . ' <= ' . $db->quote($toTime));
}
}
Expand Down Expand Up @@ -1363,7 +1367,7 @@ public function getReportLink($reportToLink, $filters)
/**
* Method to get id of the report having default set as 1
*
* @param STRING $reportId Report id
* @param STRING $reportId Report Id
*
* @return Object
*
Expand Down

0 comments on commit 8b7442b

Please sign in to comment.