           [:div
             [:div {:style (str "height: 15px; margin-left: 10px; margin-right: 10px; border: 4px solid " color-grey-1 "; border-top: none; border-bottom: none;")} "&#160;"]
             [:div {:style "height: 15px; margin-left: 10px; margin-right: 10px;"}
-              [:div {:style "float: left;"} (format-timestamp xmin)]
-              [:div {:style "float: right;"} (format-timestamp xmax)]]
+              [:div {:style "float: left;"} (format-timestamp xmin (first cols))]
+              [:div {:style "float: right;"} (format-timestamp xmax (first cols))]]
           ]]]
       [:div {:style "margin-top: 20px; margin-left: 30px;"}
         (render-table card [(last rows) (first rows)] cols render-img [0 1] nil)]]))

    :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))))

(defn- format-cell
  [value]
  (cond
    (instance? java.util.Date value) (format-timestamp (.getTime value))
    (number? value) (format-number value)
    :else (str value)))

(defn card-href

          [:tr {:style (str "color: " (if (odd? row-idx) color-grey-2 color-grey-3) ";")}
            (map (fn [col-idx]
                  [:td {:style (str bar-td-style (if (and bar-column (= col-idx 1)) "font-weight: 700;"))}
                    (-> row (nth col-idx) (format-cell (nth cols col-idx )) h)])
                  col-indexes)
            (if bar-column [:td {:style (str bar-td-style "width: 99%;")}
              [:div {:style (str "background-color: " color-purple "; height: 20px; width: " (float (* 100 (/ (bar-column row) max-value))) "%")} "&#160;"]])])
