add overlap functionality to Timex.Interval#493
Open
glassbead0 wants to merge 1 commit intobitwalker:mainfrom
Open
add overlap functionality to Timex.Interval#493glassbead0 wants to merge 1 commit intobitwalker:mainfrom
glassbead0 wants to merge 1 commit intobitwalker:mainfrom
Conversation
4 tasks
2 similar comments
8764c92 to
1b5a171
Compare
heyZeus
reviewed
Dec 10, 2018
lib/interval/interval.ex
Outdated
|
|
||
| @doc """ | ||
| Returns an Interval representing the intersection between two intervals. | ||
| If the intervals do not overlap, reutrn {:error, :no_overlap_interval}. |
heyZeus
reviewed
Dec 10, 2018
lib/interval/interval.ex
Outdated
|
|
||
| @doc """ | ||
| When calculating overlap, if two intervals share a `from` (or `until`), the overlap | ||
| interval should have a bound matching the "inner" interval (eg: if either inteval has |
* Find the overlap Interval between two intervals.
* Return {:error, :no_overlap_interval} if intervals
do not overlap, (including overlapping at one instant)
1b5a171 to
e10c8fa
Compare
pezra
reviewed
Dec 10, 2018
| Returns an Interval representing the intersection between two intervals. | ||
| If the intervals do not overlap, return {:error, :no_overlap_interval}. | ||
| If the intervals overlap at a single instant (regardless of open/closed | ||
| bounds), also return {:error, :no_overlap_interval} |
Contributor
There was a problem hiding this comment.
Perhaps it should return 0 in the case of no overlap rather than an error? Two intervals not overlapping doesn't seem like an error to me.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary of changes
do not overlap, (including overlapping at one instant)
Checklist