-
Notifications
You must be signed in to change notification settings - Fork 73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Boundaries #11
Boundaries #11
Conversation
I believe the discrete unit approach is the correct one for this package. Only allowing same-precision periods to be compared, the open/closed boundary problem becomes obsolete. We'll keep the boundary functionality, but I've also added precision support. |
If I say "hey! We have a discount from 1st Dec to 31st" I would think day 1 and 31 are included. I don't get the point of excluding them. |
If you’d say: “hey! We are open from 9:00 to 18:00” Would you close shop at
18:00 or 18:01?
|
Right, in both mine and your case 31st and 18 are anyways inside the boundaries, aren't they? |
Since no one raised any objections to this implementation, I'm going to merge the PR. |
Adding boundary support, based on what we discussed in #9.
You'll notice that the default behaviour is "both boundaries included". This might not be everyone's preferred default. I heard the arguments pro and con in #9, but am still convinced that all inclusive is the right default behaviour as long as you're comparing periods with the same accuracy.
We could always add sub classes of
Period
if desired, with other defaults.I'll leave this PR open for a while, to see what people think.
For those interested, I wrote down why I think working with precision instead of excluding boundaries is the superior approach: https://stitcher.io/blog/comparing-dates