diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/frontend/tau/util.cljs | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/frontend/tau/util.cljs b/src/frontend/tau/util.cljs index 1a3e243..d23ef9a 100644 --- a/src/frontend/tau/util.cljs +++ b/src/frontend/tau/util.cljs @@ -1,4 +1,12 @@ -(ns tau.util) +(ns tau.util + (:require + ["timeago.js" :as timeago])) + +(defn format-date + [date] + (if (-> date js/Date.parse js/isNaN) + date + (timeago/format date))) (defn format-quantity [num] |