Skip to content

Commit

Permalink
remove unnecessary code
Browse files Browse the repository at this point in the history
  • Loading branch information
[email protected] committed Dec 31, 2015
1 parent f0d232d commit 6c9b097
Showing 1 changed file with 0 additions and 15 deletions.
15 changes: 0 additions & 15 deletions src/simplecalculator/core.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -13,25 +13,10 @@

(def today (js/Date.))


(defn- before [date days]
;; "Return a new js/Date which is the given number of days before the given date"
(js/Date. (.getFullYear date) (.getMonth date) (- (.getDate date) days)))

(defn date? [x]
(= (type x) js/Date))


(defn days-between [x y]
;; "Return the number of days between the two js/Date instances"
(when (every? date? [x y])
(let [ms-per-day (* 1000 60 60 25)
x-ms (.getTime x)
y-ms (.getTime y)]
(.round js/Math (.abs js/Math (/ (- x-ms y-ms) ms-per-day)))))
)


(defn get-date! [date]
(if (date? date)
(.toLocaleDateString date "en" "%d-%b-%Y")
Expand Down

0 comments on commit 6c9b097

Please sign in to comment.