Closed coatesap closed 4 years ago
I concur
hey Andy - maybe isBetween
should just be inclusive?
i don't have strong thoughts about that either way.
@spencermountain What if we just pass in an optional boolean to be inclusive. Default to false/null that way we don't break any existing code relying on it not being inclusive.
Yep I like that too. Good idea, pr welcome.
On Fri, Mar 6, 2020 at 4:11 PM Jacob Craig notifications@github.com wrote:
@spencermountain https://github.com/spencermountain What if we just pass in an optional boolean to be inclusive. Default to false/null that way we don't break any existing code relying on it not being inclusive.
— You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub https://github.com/spencermountain/spacetime/issues/195?email_source=notifications&email_token=AADBSKJBZM2BZ6XNVLGJBOTRGFRHBA5CNFSM4LDDDYSKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEOC3X6Y#issuecomment-595966971, or unsubscribe https://github.com/notifications/unsubscribe-auth/AADBSKNJFX5H7V2HHFK2UFLRGFRHBANCNFSM4LDDDYSA .
will release this as 6.5.0 over the next few days. cheers
Wanting to check whether a date falls inside an "inclusive" date range is quite common. At the moment,
isBetween()
doesn't match against the start and end dates. Having anisBetweenInclusive()
method would be very handy.Presumably the implementation would be:
If that sounds sensible, I'm happy to open a PR for it.