I called
(clj-time.core/last-day-of-the-month 1999 2)
and
(clj-time.core/number-of-days-in-the-month 1999 2)
both throws
java.lang.NoClassDefFoundError org/joda/time/DateTime$Property org.joda.time.DateTime.dayOfMonth (DateTime.java:1971)
The docs says:
(defn last-day-of-the-month
([^long year ^long month]
(last-day-of-the-month- (date-time year month)))
([dt]
(last-day-of-the-month- dt)))
(defn number-of-days-in-the-month
(^long [^DateTime dt]
(day (last-day-of-the-month- dt)))
(^long [^long year ^long month]
(day (last-day-of-the-month- (date-time year month)))))
What's the wrong I make?
Thanks!
The following is my project settings and dependencies:
(defproject xxx "0.1.2-SNAPSHOT"
:description ""
:dependencies [[org.clojure/clojure "1.8.0"]
...
[clj-time "0.11.0"]
...)
and I tried this in project repl:
clj-time=> clj-time.core/last-day-of-the-month
#object[clj_time.core$last_day_of_the_month 0x6a86b560 "clj_time.core$last_day_of_the_month@6a86b560"]
The above results are getting from the repl server to which I connect through channeling by ssh.
When I run lein repl
in the local project folder, I can get the right result:
xxx.core=> (clj-time.core/last-day-of-the-month 2016 2)
#object[org.joda.time.DateTime 0x22a0534e "2016-02-29T00:00:00.000Z"]
xxx.core=> (clj-time.core/number-of-days-in-the-month 2016 2)
29
I am new to Clojure. Is this information useful?
After restarting the repl, the problem is solved now.