Closed ameenross closed 3 years ago
Ah yes, good catch; thanks for reporting! Do you want to submit a bugfix yourself? Otherwise I'll look at this somewhere next week.
I don't think I will be able to soon. However, thinking about this again, I think the way the boundaries are programmed means resulting periods should have boundary inclusion/exclusion depending on more factors. Basically, a period has 2 boundaries, and if one of a boundary is not included, it needs to be included in the period before or after that. So say We have this (standard interval notation, square bracket is inclusive, parenthesis is exclusive):
// ----------[ )------
// ----------------(-----]
Then there is really a "gap" between these periods in the form of a single moment in time. Or in other words, they nearly touch. So if you want to get the gap between two periods, here's what should happen:
// A: ----------[ )----------
// B: ---------------------[----)
// GAP: ----------------[----)-----
By the same token:
// A: ----------[ ]----------
// B: ---------------------[----]
// GAP: ----------------(----)-----
We'll continue this conversation in #80, it'll be fixed in v2.
At first I thought this was an off by one error, but it's not quite. It's just a nasty gotcha because the boundary exclusions are not carried over. Here's code with the problem.
I'm expecting the end to be excluded, as both input periods have EXCLUDE_END...