You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Problem: When querying for events on a recurrence having recurrence.until = date1, using recurrence.events(until: date2), where date2 >= date1, the second call to events will always fail.
Reproduce:
ruby recurring.rb -v v
# frozen_string_literal: truerequire'recurrence'require'test/unit'classRecurrenceEventsTest < Test::Unit::TestCasedefrecurrenceRecurrence.new(every: :week,on: %i[mondaytuesdaywednesdaythursday],starts: '2021-10-01',until: '2021-10-10')end# will passtest'events without start_date, end_date'dorecurrence_model=recurrenceassert_equalrecurrence_model.events,[Date.new(2021,10,4),Date.new(2021,10,5),Date.new(2021,10,6),Date.new(2021,10,7)]assert_equalrecurrence_model.events,[Date.new(2021,10,4),Date.new(2021,10,5),Date.new(2021,10,6),Date.new(2021,10,7)]end# will passtest'events with start_date, end_date within actual end_date'dorecurrence_model=recurrenceassert_equalrecurrence_model.events(starts: '2021-10-04',until: '2021-10-06'),[Date.new(2021,10,4),Date.new(2021,10,5),Date.new(2021,10,6)]assert_equalrecurrence_model.events(starts: '2021-10-04',until: '2021-10-06'),[Date.new(2021,10,4),Date.new(2021,10,5),Date.new(2021,10,6)]end# will fail, date2 = date1test'events with start_date, end_date as actual end_date'dorecurrence_model=recurrenceassert_equalrecurrence_model.events(starts: '2021-10-04',until: '2021-10-10'),[Date.new(2021,10,4),Date.new(2021,10,5),Date.new(2021,10,6),Date.new(2021,10,7)]assert_equalrecurrence_model.events(starts: '2021-10-04',until: '2021-10-10'),[Date.new(2021,10,4),Date.new(2021,10,5),Date.new(2021,10,6),Date.new(2021,10,7)]end# will fail, date2 = date1, using events!test'events with start_date, end_date as actual end_date (using events!)'dorecurrence_model=recurrenceassert_equalrecurrence_model.events!(starts: '2021-10-04',until: '2021-10-10'),[Date.new(2021,10,4),Date.new(2021,10,5),Date.new(2021,10,6),Date.new(2021,10,7)]assert_equalrecurrence_model.events!(starts: '2021-10-04',until: '2021-10-10'),[Date.new(2021,10,4),Date.new(2021,10,5),Date.new(2021,10,6),Date.new(2021,10,7)]end# will fail, date2 > date1test'events with start_date, end_date outside end_date'dorecurrence_model=recurrenceassert_equalrecurrence_model.events(starts: '2021-09-30',until: '2021-10-15'),[Date.new(2021,10,4),Date.new(2021,10,5),Date.new(2021,10,6),Date.new(2021,10,7)]assert_equalrecurrence_model.events(starts: '2021-09-30',until: '2021-10-15'),[Date.new(2021,10,4),Date.new(2021,10,5),Date.new(2021,10,6),Date.new(2021,10,7)]end# will fail, date2 > date1, using events!test'events with start_date, end_date outside end_date (using events!)'dorecurrence_model=recurrenceassert_equalrecurrence_model.events!(starts: '2021-09-30',until: '2021-10-15'),[Date.new(2021,10,4),Date.new(2021,10,5),Date.new(2021,10,6),Date.new(2021,10,7)]assert_equalrecurrence_model.events!(starts: '2021-09-30',until: '2021-10-15'),[Date.new(2021,10,4),Date.new(2021,10,5),Date.new(2021,10,6),Date.new(2021,10,7)]endend
Version:1.3.0
The text was updated successfully, but these errors were encountered:
Problem: When querying for events on a
recurrence
havingrecurrence.until = date1
, usingrecurrence.events(until: date2)
, wheredate2 >= date1
, the second call toevents
will always fail.Reproduce:
ruby recurring.rb -v v
Version:
1.3.0
The text was updated successfully, but these errors were encountered: