Skip to content

Instantly share code, notes, and snippets.

@pgaertig
Created May 4, 2015 21:19
Show Gist options
  • Save pgaertig/e20aeef4d3ee4d910893 to your computer and use it in GitHub Desktop.
Save pgaertig/e20aeef4d3ee4d910893 to your computer and use it in GitHub Desktop.
MomentJS with ClojureScript
(ns kpapi.utils)
(enable-console-print!)
(defn moment [arg] (.moment js/window arg))
(defn fmt-date-short [str]
(if str (-> (moment str) (.format "MM-DD HH:mm")) "-"))
(defn fmt-date-time [str]
(if str (-> (moment str) (.format "YYYY-MM-DD HH:mm")) "-"))
(defn fmt-date-words [str]
(if str (-> (moment str) (.calendar)) "-"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment