Compute differences between DateInterval
s with timeInterval(to:)
and dateInterval(to:)
methods.
#327
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.
Implements #326.
Please read #326 where I explain how I expect this needs a pitch and review and asks what I should do next.
What?
Returns the seconds between
self
anddateInterval
ornil
if there is no difference in time between them.For example, given these two intervals on a timeline:
Returns a negative time interval when
self
ends beforedateInterval
starts. A postive time interval indicatesself
starts afterdateInterval
ends.A return value of
0
indicatesself
starts or ends wheredateInterval
ends or starts (in other words, they intersect at their opposing start/end moments):A return value of
nil
indicatesself
anddateInterval
do not have any time between them:Testing
I have included unit tests.
I was not able to build and test on Xcode 15b3:
As such, I am relying on any CI to build and test these changes.