Skip to content

Commit 2336c92

Browse files
committed
Pass range as options
1 parent 2cf2cc6 commit 2336c92

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/ice_cube/schedule.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,8 @@ def remaining_occurrences_enumerator(from = nil, options = {})
209209

210210
# Occurrences between two times
211211
def occurrences_between(begin_time, closing_time, options = {})
212-
enumerate_occurrences(begin_time, closing_time, options).to_a
212+
range_options = {range_start: begin_time, range_end: closing_time}
213+
enumerate_occurrences(start_time, closing_time, options.merge(range_options)).to_a
213214
end
214215

215216
# Return a boolean indicating if an occurrence falls between two times
@@ -432,6 +433,7 @@ def enumerate_occurrences(opening_time, closing_time = nil, options = {})
432433
t1 = start_time if t1 < start_time
433434
loop do
434435
break unless (t0 = next_time(t1, closing_time))
436+
break if t0 < options[:range_start]
435437
break if closing_time && t0 > closing_time
436438
if spans ? (t0.end_time > opening_time) : (t0 >= opening_time)
437439
yielder << (block_given? ? yield(t0) : t0)

0 commit comments

Comments
 (0)