Returns true if the given DateTime matches the time range indicated by the
filter/rule.
@param currentTime
@param filter
543414
private boolean matchesTime(TimeRestrictedAccess filter) {
        Date start = filter.getTimeStart();
        Date end = filter.getTimeEnd();
        if (end == null || start == null) {
            return true;
        }
        long startMs = start.getTime();
        long endMs = end.getTime();
        DateTime currentTime = new LocalTime(DateTimeZone.UTC).toDateTime(new DateTime(0l));
        long nowMs = currentTime.toDate().getTime();
        
        return nowMs >= startMs && nowMs < endMs;
    }
317285
def parse_solr_time_range_as_pair(time_filter):
    
    pattern = "\\[(.*) TO (.*)\\]"
    matcher = re.search(pattern, time_filter)
    if matcher:
        return matcher.group(1), matcher.group(2)
    else:
        raise Exception("Regex {0} couldn't parse {1}".format(pattern, time_filter))
160722
def match(self, rule):
        
        if len(self.filters) == 0:
            return True

        for filter in self.filters:
            if filter.match(rule):
                return True
        return False
528070
public boolean matchesFilter(String filter, int priValue, int secValue) {

        filter = filter.toLowerCase();
        return m_parameters[priValue].toLowerCase().contains(filter)
            || m_parameters[secValue].toLowerCase().contains(filter);
    }
1289938
def datetime_match(data, dts):
    
    dts = dts if islistable(dts) else [dts]
    if any([not isinstance(i, datetime.datetime) for i in dts]):
        error_msg = (
            "`time` can only be filtered by datetimes"
        )
        raise TypeError(error_msg)
    return data.isin(dts)
936592
public function applyFilterDateRange(Filter\FilterDateRange $filter)
	{
		$conditions = $filter->getCondition();
		$c = $this->checkAliases($filter->getColumn());

		$value_from = $conditions[$filter->getColumn()]['from'];
		$value_to = $conditions[$filter->getColumn()]['to'];

		if ($value_from) {
			try {
				$date_from = DateTimeHelper::tryConvertToDate($value_from, [$filter->getPhpFormat()]);
				$date_from->setTime(0, 0, 0);

				$p = $this->getPlaceholder();

				$this->data_source->andWhere("$c >= :$p")->setParameter($p, $date_from->format('Y-m-d H:i:s'));
			} catch (DataGridDateTimeHelperException $ex) {
				// ignore the invalid filter value
			}
		}

		if ($value_to) {
			try {
				$date_to = DateTimeHelper::tryConvertToDate($value_to, [$filter->getPhpFormat()]);
				$date_to->setTime(23, 59, 59);

				$p = $this->getPlaceholder();

				$this->data_source->andWhere("$c <= :$p")->setParameter($p, $date_to->format('Y-m-d H:i:s'));
			} catch (DataGridDateTimeHelperException $ex) {
				// ignore the invalid filter value
			}
		}
	}
502915
public function applyFilterDate(Filter\FilterDate $filter)
	{
		foreach ($filter->getCondition() as $column => $value) {
			try {
				$date = DateTimeHelper::tryConvertToDateTime($value, [$filter->getPhpFormat()]);
				$date_end = clone $date;

				$this->data_source = $this->data_source->findBy([
					$this->prepareColumn($column) . '>=' => $date->setTime(0, 0, 0),
					$this->prepareColumn($column) . '<=' => $date_end->setTime(23, 59, 59),
				]);
			} catch (DataGridDateTimeHelperException $ex) {
				// ignore the invalid filter value
			}
		}

		return $this;
	}
281475
public <E extends Exception> boolean anyMatch(Try.BytePredicate<E> filter) throws E {
        return anyMatch(0, size(), filter);
    }
173730
public boolean matchesBrowser(String currentBrowser) {

        if (currentBrowser == null) {
            return false;
        }
        for (int i = 0; i < getBrowserPattern().size(); i++) {
            boolean matches = getBrowserPattern().get(i).matcher(currentBrowser.trim()).matches();
            if (matches) {
                if (LOG.isDebugEnabled()) {
                    LOG.debug(Messages.get().getBundle().key(Messages.LOG_BROWSER_MATCHES_CONFIG_1, currentBrowser));
                }
                return true;
            }
        }
        return false;
    }
615493
public static current_timezone[] get_filtered(nitro_service service, String filter) throws Exception
	{
		current_timezone obj = new current_timezone();
		options option = new options();
		option.set_filter(filter);
		current_timezone[] response = (current_timezone[]) obj.getfiltered(service, option);
		return response;
	}
472179
def match(self, item):
        
        if getattr(item, self._name) is None:
            # Never match "N/A" items, except when "-0" was specified
            return False if self._value else self._cmp(-1, 0)
        else:
            return super(DurationFilter, self).match(item)
944296
public <E extends Exception> boolean noneMatch(Try.LongPredicate<E> filter) throws E {
        return noneMatch(0, size(), filter);
    }
1123307
public <E extends Exception> boolean anyMatch(Try.DoublePredicate<E> filter) throws E {
        return anyMatch(0, size(), filter);
    }
1022520
def match?(time, base)
      aligned?(time, base) && @filters.all? { |f| f.match?(time) }
    end
811113
public T filter(@NonNull SerializablePredicate<? super HString> filter) {
      this.filter = filter;
      return Cast.as(this);
   }
21334
def matches?(time)

      # FIXME Don't create a new ZoTime if time is already a ZoTime in same
      #       zone ...
      #       Wait, this seems only used in specs...
      t = ZoTime.new(time.to_f, @timezone)

      return false unless sub_match?(t, :sec, @seconds)
      return false unless sub_match?(t, :min, @minutes)
      return false unless sub_match?(t, :hour, @hours)
      return false unless date_match?(t)
      true
    end
430697
public function applyFilterDateRange(Filter\FilterDateRange $filter)
	{
		$conditions = $filter->getCondition();

		$value_from = $conditions[$filter->getColumn()]['from'];
		$value_to = $conditions[$filter->getColumn()]['to'];

		if ($value_from) {
			try {
				$date_from = DateTimeHelper::tryConvertToDateTime($value_from, [$filter->getPhpFormat()]);
				$date_from->setTime(0, 0, 0);

				$this->data_source->where('DATE(%n) >= ?', $filter->getColumn(), $date_from);
			} catch (DataGridDateTimeHelperException $ex) {
				// ignore the invalid filter value
			}
		}

		if ($value_to) {
			try {
				$date_to = DateTimeHelper::tryConvertToDateTime($value_to, [$filter->getPhpFormat()]);
				$date_to->setTime(23, 59, 59);

				$this->data_source->where('DATE(%n) <= ?', $filter->getColumn(), $date_to);
			} catch (DataGridDateTimeHelperException $ex) {
				// ignore the invalid filter value
			}
		}
	}