Skip to main content

Date.down_to

down_toendinclude_endstep

Group: Input
Aliases: date range

Documentation

Creates a decreasing range of dates from self to end.

Arguments

  • end: The end of the range.
  • include_end: Specifies if the right end of the range should be included. By default, the range is right-exclusive.

Examples

Create a reverse range of dates.

      (Date.new 2021 12 10).down_to (Date.new 2021 12 05)

Create a range containing dates [2021-12-06, 2021-12-05].

      (Date.new 2021 12 06).down_to (Date.new 2021 12 05) include_end=True