I'm having a little bit of trouble understanding where to go with this error. Or where I should be looking for an example/documentation. I'm leaning towards the cljc.java-time lib to be able to use it in Clojure and ClojureScript.
(ns cljexplore.core
(:require [cljc.java-time.local-date :as ld])
(:require [cljc.java-time.period :as period])
(:require [cljc.java-time.duration :as duration]))
(def bbday (ld/parse "2021-11-12"))
(def today (ld/now))
(defn -main
[& args]
(let [dur (period/between today bbday)]
(println (period/of-days dur))))
When I try to run this program I get an error of: class java.time.Period cannot be cast to class java.lang.Number (java.time.Period and java.lang.Number are in module java.base of loader 'bootstrap')
Not sure where to go from here to get simple calculation of distance between two dates with this library. Could use a nudge in the right direction.
Perhaps, this is what you're looking for:
(require '[cljc.java-time.temporal.chrono-unit :as chrono-unit])
(chrono-unit/between chrono-unit/days today bbday)
=> 100