juxt

2020-07-13T05:29:51.193300Z

What is an ival ?

(defn intersects? [ivals interval]
  (not-empty (intersection ivals [interval])))

2020-07-13T05:31:31.193900Z

ivals

refset 2020-07-13T08:23:17.194100Z

the example on the docs shows:

(t/intersects? [(t/year)]
               (t/inc (t/year)))

2020-07-13T14:43:18.194300Z

Doesn't seem like intersects? works with a non-interval....

=> t4
#time/zoned-date-time "2020-07-04T00:00-07:00[US/Pacific]"

=> ti
#:tick{:beginning #time/zoned-date-time "2020-07-04T00:00-07:00[US/Pacific]", :end #time/zoned-date-time "2020-07-05T00:00-07:00[US/Pacific]"}

=> (t/intersects? t4 ti)
Execution error (UnsupportedOperationException) at tick.interval/assert-proper-head (interval.cljc:427).
nth not supported on this type: ZonedDateTime

refset 2020-07-13T15:00:18.194500Z

comparing with the reference code I posted, what happens when you add a vector in there (t/intersects? [t4] ti)

2020-07-13T17:14:49.194700Z

Not sure how to interpret this:

=> (t/intersects? [t4] ti)
nil

2020-07-13T17:46:28.194900Z

Also:

=> (t/intersects? [ti] ti)
(#:tick{:beginning #time/zoned-date-time "2020-07-04T00:00-07:00[US/Pacific]", :end #time/zoned-date-time "2020-07-05T00:00-07:00[US/Pacific]"})

2020-07-13T17:47:17.195100Z

I question the use of the question mark at the end of this function name 🙂

tomd 2020-07-13T17:58:01.195300Z

The tick versions of >= etc are variadic just like clojure.core's, so your within? function could just be:

(t/<= (t/beginning i) time (t/end i))
I'm not sure there is a shorter version than that

1😎
2020-07-13T18:46:23.195500Z

@tomd Nice! Thanks for the tip!

1🙂