Closed sonwh98 closed 8 years ago
used moment.js instead
(require [cljsjs.moment])
(defn str->date [date-as-str]
(let [m (-> date-as-str (js/moment. "MM/DD/YYYY"))]
(. m toDate)))
(defn date->str [date]
(.. (js/moment. date) (format "MM/DD/YYYY")))
The pattern DD means day of the year. Lowercase dd is what you want for day of month.
On Fri, 24 Jun 2016 05:14 Sonny To, notifications@github.com wrote:
used moment.js instead
(require [cljsjs.moment])
(defn str->date [date-as-str](let [m %28-> date-as-str %28js/moment.))] (. m toDate)))
(defn date->str [date](.. %28js/moment. date%29 %28format)))
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/andrewmcveigh/cljs-time/issues/66#issuecomment-228254365, or mute the thread https://github.com/notifications/unsubscribe/AALnm4T3NA6ywnIJotovG1jHxeoOHZqkks5qO1mggaJpZM4I9cO0 .
Am I using unparse incorrectly? why does it give "06/175/2016" and not "06/23/2016"?. I am using [org.clojure/clojurescript "1.9.76"]