1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 21:22:58 +01:00

Add finer grained resolution to created_at query

This commit is contained in:
David Bomba 2022-12-21 19:45:27 +11:00
parent cfe2d397da
commit d0f18647ed

View File

@ -174,25 +174,22 @@ abstract class QueryFilters
}
}
public function created_at($value = '')
public function created_at($value)
{
$created_at = $value ? (int) $value : 0;
if($value == '')
$created_at = date('Y-m-d H:i:s', $value);
if(is_string($created_at)){
$created_at = strtotime(str_replace("/","-",$created_at));
if(!$created_at)
return $this->builder;
try{
$created_at = Carbon::parse($value)->timestamp;
}
return $this->builder->where('created_at', '>=', $created_at);
}
catch(\Exception $e) {
return $this->builder;
}
}
public function is_deleted($value)