Skip to content

Option to include prior occurrences with overlapping duration - #302

Merged
seejohnrun merged 4 commits into
ice-cube-ruby:masterfrom
bookwhen:master
Feb 23, 2016
Merged

Option to include prior occurrences with overlapping duration#302
seejohnrun merged 4 commits into
ice-cube-ruby:masterfrom
bookwhen:master

Conversation

@jopotts

@jopotts jopotts commented Oct 1, 2015

Copy link
Copy Markdown
Contributor

Adding an option on schedule methods to include occurrences whose duration intersects a time window. Issue #154

#154

Adding an option on schedule methods to include occurrences whose duration intersects a time window. Issue #154

#154
@jopotts

jopotts commented Oct 1, 2015

Copy link
Copy Markdown
Contributor Author

I opted for a simple defaulted option on the schedule methods. It's not as descriptive as what was proposed in this thread but it seemed to fit in with the rest of the code better the way I've done it, and a named param might reduce compatibility with older Rubys?

Unecessarily setting the start time search back to the start of the schedule for a spanned search, when in fact it simply needs to step back a duration.
The spans checks were incorrectly returning a hit when the end of the duration for an event ended on the same time as the start time checks. Allows occurring_between? method to now be simplifed to use the spanned check.
@Chosko

Chosko commented Feb 16, 2016

Copy link
Copy Markdown

I need this too. It would be great to have it merged..

@Chosko

Chosko commented Feb 22, 2016

Copy link
Copy Markdown

@seejohnrun any chance to see this merged?

@jopotts

jopotts commented Feb 22, 2016

Copy link
Copy Markdown
Contributor Author

@avit It's well covered by tests and has been in production for us for months. No problems. It would be great to get it merged.

@Chosko Thanks for pushing for the merge.

@Chosko

Chosko commented Feb 22, 2016

Copy link
Copy Markdown

I use it in production too.. And it works great

@seejohnrun

Copy link
Copy Markdown
Collaborator

This is cool! definitely down to merge
Is it worth having spans as an option in an option hash so it's more clear?

ie: spans: true

Swapping the new spans parameter for an options hash to make the method calls more specific in their meaning.
@jopotts

jopotts commented Feb 23, 2016

Copy link
Copy Markdown
Contributor Author

You're right. Much neater. I've updated the PR. Not sure what's going on with the Travis failures. Tests pass ok. Looking forward to the merge. Thanks!

seejohnrun added a commit that referenced this pull request Feb 23, 2016
Option to include prior occurrences with overlapping duration
@seejohnrun
seejohnrun merged commit 656a3b4 into ice-cube-ruby:master Feb 23, 2016
@seejohnrun

Copy link
Copy Markdown
Collaborator

Thanks all - will be out as part of 0.14.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants