News:

Dear forum visitors, if the support forum is not available, please try again a few minutes later. Thanks!

Main Menu
Support-Forum

Datetime rather than Date

Started by ColinM, 22.08.2019 13:41:35

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

ColinM

Originally posted by EURRWebmaster in 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$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:$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 
Colin M
  •  

Tazzios

For safety also convert the parameters to date:$query->where(date('.$dateField.') >= date('.$startDateRange.') AND date('.$dateField .
') <= date('.$endDateRange.'));

Tazzios

Corection (at the end) $query->where('date('.$dateField.') >= date('.$startDateRange.') AND date('.$dateField .
') <= date('.$endDateRange . '))';