public static function filterRangeDate(
        QueryBuilder $queryBuilder,
        &$criteria,
        $field,
        $fieldFrom,
        $fieldTo,
        $alias = 'o'
    ) {
        if (isset($criteria[$fieldFrom]) || isset($criteria[$fieldTo]) && $criteria[$fieldTo] != '') {
            if (!empty($criteria[$fieldFrom])) {
                $from = $criteria[$fieldFrom].' 00:00:00';
                $queryBuilder
                    ->andWhere($queryBuilder->expr()->gte(sprintf('%s.%s', $alias, $field), sprintf(':%s', $fieldFrom)))
                    ->setParameter($fieldFrom, \DateTime::createFromFormat('d/m/Y H:i:s', $from));
            }
            unset($criteria[$fieldFrom]);
            if (!empty($criteria[$fieldTo])) {
                $to = $criteria[$fieldTo].' 23:59:59';
                $queryBuilder
                    ->andWhere($queryBuilder->expr()->lte(sprintf('%s.%s', $alias, $field), sprintf(':%s', $fieldTo)))
                    ->setParameter($fieldTo, \DateTime::createFromFormat('d/m/Y H:i:s', $to));
            }
            unset($criteria[$fieldTo]);
        }

        return $criteria;
    }