public function filter($content, $search, $type)
    {
        $search = is_array($search) ? $search : [$search];
        $search = array_map(function($searchValue) {return is_a($searchValue, Carbon::class) ? $searchValue : new Carbon($searchValue);}, $search);
        $current = (new Carbon($content));
        switch ($type) {
            case 'in':
                return ($current->gte($search[0]) && $current->lt($search[1]));
                break;
            default:
                return $current->eq($search[0]);
        }
    }
public function filter($content, $search, $type)
    {
        $search = is_array($search) ? $search : [$search];
        $search = array_map(function($searchValue) {return is_a($searchValue, Carbon::class) ? $searchValue : new Carbon($searchValue);}, $search);
        $current = (new Carbon($content));
        switch ($type) {
            case 'in':
                return ($current->gte($search[0]) && $current->lt($search[1]));
                break;
            default:
                return $current->eq($search[0]);
        }
    }
public function filter ( $ content , $ search , $ type ) { $ search = is_array ( $ search ) ? $ search : [ $ search ] ; $ search = array_map ( function ( $ searchValue ) { return is_a ( $ searchValue , Carbon :: class ) ? $ searchValue : new Carbon ( $ searchValue ) ; } , $ search ) ; $ current = ( new Carbon ( $ content ) ) ; switch ( $ type ) { case 'in' : return ( $ current -> gte ( $ search [ 0 ] ) && $ current -> lt ( $ search [ 1 ] ) ) ; break ; default : return $ current -> eq ( $ search [ 0 ] ) ; } }
Datetime exact match check as well as between check
@param string $content
@param string $search
@param string $type
@return bool
Datetime exact match check as well as between check