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
Feature description (Mandatory)
This function should take two timespans, broken into start and end temporal values for each (and an optional boolean for whether an adjacent timespans are considered overlapping, true by default), and returns a boolean on whether the two timespans overlap.
The general formula for calculating overlap is:
max(start1, start2) <= min(end1, end2)
If acceptAdjacentSpans:false, then this uses < instead.
InverseFalcon
changed the title
Create apoc.temporal.overlap(start1, end1, start2, end2, acceptAdjacentSpans) function
Create apoc.temporal.overlap(start1, end1, start2, end2, acceptAdjacentSpans:true) function
Mar 30, 2020
Feature description (Mandatory)
This function should take two timespans, broken into start and end temporal values for each (and an optional boolean for whether an adjacent timespans are considered overlapping, true by default), and returns a boolean on whether the two timespans overlap.
The general formula for calculating overlap is:
max(start1, start2) <= min(end1, end2)
If
acceptAdjacentSpans:false
, then this uses<
instead.This overlap formula is proved in this Stack Overflow answer:
https://stackoverflow.com/a/325964
This function acts as a shorthand, as this formula is likely not commonly known.
Considered alternatives
None considered at this time.
How this feature can improve the project?
Determining time range overlap is a common use case, and we don't currently have anything native or in APOC to deal with this.
The text was updated successfully, but these errors were encountered: