Date_Range.at
atindex
Group: Selections
Documentation
Gets an element from the range at a specified index (0-based).
Arguments
index
: The location in the range to get the element from. The index is also allowed be negative, then the elements are indexed from the back, i.e. -1 will correspond to the last element.
Examples
Get the second element of a range.
(Date.new 2023 04 05) . up_to (Date.new 2023 04 07) . get 1 == (Date.new 2023 04 06)
Get the last element of a range with step.
(Date.new 2023 04 05) . up_to (Date.new 2023 10 07) . with_step Date_Period.Month . get -1 == (Date.new 2023 10 05)