Skip to main content

Date.up_to

up_toendinclude_endstep

Group: Input
Aliases: date range

Documentation

Creates an increasing 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.
  • step: The step of the range. It can be a Date_Period or Period. By default, the step is one day.

Examples

Create a range of dates.

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

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

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