Schedule find_occurrence when interval is greater than 1 won't use the start date causing invalid results #92
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I found when the
find_occurrences
function is called inSchedule
that it wants to start from theopening_time
when looping to find the occurrences between thebegin_time
andend_time
when the interval is greater than 1. When the interval is > 1 I believe it should begin looping at thestart_time
to make sure when it gets to theopening_time
and theclosing_time
that it knows that the occurrence falls in the range.I added
@interval
in daily_interval.rb, weekly_interval.rb, monthly_interval.rb, and yearly_interval.rb to allowRule
to have access to it. Then I altered thefull_required?
method to check the interval and make sure it exists and if > 1 to return true.