News:

Support for jDownloads 3 has been ended
Since 17 August 2023 Joomla.org has discontinued support for Joomla 3.x. Therefore, we will no longer offer official support for our Joomla 3 jDownloads version 3.9.x from January 2024.
Please update your website to the latest Joomla version (Joomla 4 or Joomla 5) as soon as possible. Afterwards, please update jDownloads to the latest published version. The longer you delay, the more difficult the upgrade process for your website is likely to be.

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 . '))';