jDownloadsownloads.com


Support-Forum

jDownloads for Joomla 3.x => jDownloads 3.2 => Bugs => Topic started by: ColinM on 22.08.2019 13:41:35

Title: Datetime rather than Date
Post by: ColinM on 22.08.2019 13:41:35
Originally posted by EURRWebmaster in http://www.jdownloads.com/forum/index.php?topic=11682.msg43782#msg43782 (http://www.jdownloads.com/forum/index.php?topic=11682.msg43782#msg43782)

The code components/com_jdownloads/models/downloads.php 470 and 473 (jD 32..65) currently checks datetime instead of only the date I guess this is a bug.Original
Code: [Select]
$startDateRange = $db->Quote($this->getState('filter.start_date_range', $nullDate));
$endDateRange = $db->Quote($this->getState('filter.end_date_range', $nullDate));
$query->where('('.$dateField.' >= '.$startDateRange.' AND '.$dateField .
                    ' <= '.$endDateRange.')');
Here is an fix which is in the $query:
Code: [Select]
$startDateRange = $db->Quote($this->getState('filter.start_date_range', $nullDate));
$endDateRange = $db->Quote($this->getState('filter.end_date_range', $nullDate));     
$query->where(date('.$dateField.') >= '.$startDateRange.' AND date('.$dateField .
') <= '.$endDateRange.');

 Colin 
Title: Re: Datetime rather than Date
Post by: EURRWebmaater on 25.08.2019 15:27:35
For safety also convert the parameters to date:
Code: [Select]
$query->where(date('.$dateField.') >= date('.$startDateRange.') AND date('.$dateField .
') <= date('.$endDateRange.'));
Title: Re: Datetime rather than Date
Post by: EURRWebmaater on 25.08.2019 15:46:42
Corection (at the end)
Code: [Select]
$query->where('date('.$dateField.') >= date('.$startDateRange.') AND date('.$dateField .
') <= date('.$endDateRange . '))';