square/ruby-rrule

Error when RRule::Rule initialized with Date for dtstart

owen-c opened this issue · 1 comments

See code below for test case.

Error is " NoMethodError: undefined method `each' for Tue, 10 Nov 2020 00:00:00.000000000 UTC +00:00:Time"

string = "FREQ=WEEKLY;INTERVAL=1;WKST=SU"

start_time = Time.zone.iso8601('2020-11-10')
end_time = Time.zone.iso8601('2020-11-17')
rrule = RRule::Rule.new(string, dtstart: start_time.to_date)
      
# This works
# rrule = RRule::Rule.new(string, dtstart: start_time)

result = rrule.between(start_time, end_time)
assert_equal [start_time, start_time + 1.week], result

Fix merged