     :else (str (cl-format nil "~,1f" n))))
 
 (defn- format-timestamp
-  [timestamp]
-  (let [date (c/from-long timestamp)
-        today (t/today-at 0 00)]
-    (cond
-      (t/within? (t/interval today (t/plus today (t/days 1))) date) "Today"
-      (t/within? (t/interval (t/minus today (t/days 1)) today) date) "Yesterday"
-      :else (f/unparse (f/formatter "MMM d, YYYY") date))))
+  [timestamp col]
+  (log/info timestamp)
+  (case (:unit col)
+    :hour (f/unparse (f/formatter "h a - MMM YYYY") (c/from-long timestamp))
+    :week (f/unparse (f/formatter "w - YYYY") (c/from-long timestamp))
+    :month (f/unparse (f/formatter "MMMM YYYY") (c/from-long timestamp))
+    :quarter (str "Q" (+ 1 (int (/ (t/month (c/from-long timestamp)) 3))) " - " (t/year (c/from-long timestamp)))
+    :year (str timestamp)
+    :hour-of-day (str timestamp) ; TODO: probably shouldn't even be showing sparkline for x-of-y groupings?
+    :day-of-week (str timestamp)
+    :week-of-year (str timestamp)
+    :month-of-year (str timestamp)
+    (let [date (c/from-long timestamp)
+          today (t/today-at 0 00)]
+      (cond
+        (t/within? (t/interval today (t/plus today (t/days 1))) date) "Today"
+        (t/within? (t/interval (t/minus today (t/days 1)) today) date) "Yesterday"
+        :else (f/unparse (f/formatter "MMM d, YYYY") date)))))
 
 (defn- format-cell
-  [value]
+  [value col]
+  (log/info value)
   (cond
-    (instance? java.util.Date value) (format-timestamp (.getTime value))
-    (number? value) (format-number value)
+    (instance? java.util.Date value) (format-timestamp (.getTime value) col)
+    (and (number? value) (not (datetime-field? col))) (format-number value)
     :else (str value)))
 
 (defn card-href


(defn render-card-sparkline
  [card {:keys [rows cols] :as data} render-img]
  (let [xs (map #(-> % first .getTime) rows)
        xmin (apply min xs)
        xmax (apply max xs)
        xrange (- xmax xmin)

      (render-truncation-warning card data render-img rows-limit 2)]))

(defn render-card-scalar
  [card {:keys [cols rows] :as data} render-img]
  [:div {:style scalar-style}
    (-> rows first first (format-cell (first cols)) h)])

(def ^:private sparkline-dot-radius 6)
(def ^:private sparkline-thickness 4)
