Fix filtro per data

This commit is contained in:
Pek5892 2023-07-05 17:01:42 +02:00
parent c6cbf04775
commit d8f408fba0
1 changed files with 4 additions and 2 deletions

View File

@ -214,8 +214,10 @@ class Query
$value = trim(str_replace(['<', '>'], '', $value));
if ($more || $minus) {
if( date("Y-d-m",strtotime($value))!='1970-01-01' ){
$search_filters[] = $search_query.' '.$sign.' \''.date("Y-d-m",strtotime($value)).'\'';
list($giorno, $mese, $anno)=explode('/', $value);
$data="'".$anno."-".$mese."-".$giorno."'";
if( $data!="'1970-01-01'" ){
$search_filters[] = $search_query.' '.$sign.' '.$data.'';
}else{
$search_filters[] = 'CAST('.$search_query.' AS UNSIGNED) '.$sign.' '.prepare($value);
}