Skip to main content

Date_Range.filter

filterfilter

Group: Selections

Documentation

Returns a vector of all elements of this range which satisfy a condition.

Arguments

  • filter: The filter to apply to the range. It can either be an instance of Filter_Condition or a predicate taking a value and returning a boolean value indicating whether the corresponding element should be kept or not.

Examples

Selecting all elements that are greater than 2020-10-12.

      (Date.new 2020 10 01).up_to (Date.new 2020 10 15) . filter (> (Date.new 2020 10 12))
(Date.new 2020 10 01).up_to (Date.new 2020 10 15) . filter (..Greater than=(Date.new 2020 10 12))