parent
5ce17d3aa8
commit
9c0e888284
@ -0,0 +1,23 @@
|
|||||||
|
(ns blog.helpers
|
||||||
|
(:require ["date-fns" :refer [format]]))
|
||||||
|
|
||||||
|
(defn truncatestring-factory
|
||||||
|
[]
|
||||||
|
(fn [text limit]
|
||||||
|
(-> (. text substring 0 limit)
|
||||||
|
(str "..."))))
|
||||||
|
|
||||||
|
(defn full-timestamp-factory
|
||||||
|
[]
|
||||||
|
(clj->js
|
||||||
|
(fn [timestamp]
|
||||||
|
(format timestamp "HH:mm MMM. do, yyyy"))))
|
||||||
|
|
||||||
|
(defn is-brief-factory
|
||||||
|
[]
|
||||||
|
(clj->js
|
||||||
|
(fn [length]
|
||||||
|
(if (> length 60)
|
||||||
|
"..."
|
||||||
|
""))))
|
||||||
|
|
Loading…
Reference in new issue