Fix #17491 : date extrafield filter works well now
This commit is contained in:
Laurent Destailleur 2021-05-11 21:15:50 +02:00 committed by GitHub
commit 4ec763a436
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -23,7 +23,13 @@ if (!empty($extrafieldsobjectkey) && !empty($search_array_options) && is_array($
if ($crit != '' && in_array($typ, array('date', 'datetime', 'timestamp')))
{
$sql .= " AND ".$extrafieldsobjectprefix.$tmpkey." = '".$db->idate($crit)."'";
if ($typ == 'date'){
include_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
$crit = dol_get_first_hour($crit);
$sql .= " AND ".$extrafieldsobjectprefix.$tmpkey." = '".$db->idate($crit)."'";
}else {
$sql .= " AND ".$extrafieldsobjectprefix.$tmpkey." = '".$db->idate($crit)."'";
}
} elseif (in_array($typ, array('boolean')))
{
if ($crit !== '-1' && $crit !== '') {