Skip to content
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

Add inclusivity to within? #132

Open
foilofbob opened this issue Jul 31, 2018 · 0 comments
Open

Add inclusivity to within? #132

foilofbob opened this issue Jul 31, 2018 · 0 comments

Comments

@foilofbob
Copy link

The within? function has the inclusivity on the end date commented out currently, and the comments suggest that it should not be.

(defn within?
  "With 2 arguments: Returns true if the given Interval contains the given
  DateTime. Note that if the DateTime is exactly equal to the
  end of the interval, this function returns false.

  With 3 arguments: Returns true if the start DateTime is
  equal to or before and the end DateTime is equal to or after the test
  DateTime."
  ([{:keys [start end]} date]
   (within? start end date))
  ([start end date]
   (or (= start date)
       ;(= end date)
       (and (before? start date) (after? end date)))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant