Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
A period must contain at least its starting datepoint #31
Hi - first of all thanks for the small but sweet package, will be useful for overlapping periods validation.
While going through the code I noticed that the constructor is accepting the same $startDate and $endDate, with a notable exception message 'the ending endpoint must be greater or equal to the starting endpoint'.
On the other hand the contains method expects the input $datetime to be: stricktly smaller than the endDate. This suggests to me that the ending endPoint is considered to be outside the period. This last bit doesn't seem to be in line with the check in the constructor?
This is as expected and as described in the documentation.
Because you need to be able to represent
Agreed, re-reading the documentation - that's clear, please close this
I would consider the starting endPoint to always be inside the Period. If the starting endPoint and the ending endPoint are the same, then the starting endPoint is also outside the Period -- that last bit sounds a bit strange to me. Specifically if you rephrase it as follows: sometimes the starting endPoint is inside the Period, but usually (when the duration > 0) it's inside :)
I also understand that diff, abuts and intersect highly depend on this concept - so I will also adopt your point of view.
cheers & thanks