   (* hours 3600000))
 
 (defn sync-time-with-snapshot! []
-  (reset! selected-time (:time (@snapshot-list @snapshot-index))))
+  (reset! selected-time (.-time (nth @snapshot-list @snapshot-index))))
 
 ; TODO: This could be improved. Probably need to rethink my data model
 (defn show-closest-snapshot! []
   (let [timestamp @selected-time
-        earlier-index (first (keep-indexed #(if (>= timestamp (:time %2)) %1) @snapshot-list))
+        earlier-index (first (keep-indexed #(if (>= timestamp (.-time %2)) %1) @snapshot-list))
         later-index (max (dec earlier-index) 0)
-        later (:time (@snapshot-list later-index))
-        earlier (:time (@snapshot-list earlier-index))
+        later (.-time (nth @snapshot-list later-index))
+        earlier (.-time (nth @snapshot-list earlier-index))
         display-index (if (< (- later timestamp) (- timestamp earlier))
                         later-index
                         earlier-index)]


(defn init-snapshot-list []
  (->> (.-SNAPSHOT_LIST js/window) ; server injected to this in a <script>
       (js->clj)
       (clojure.walk/keywordize-keys)
       (reset! snapshot-list)))

(defn init-snapshot-index []
  (let [image (attr ($ "#currentSnapshot") "src")
        starting-index (first (keep-indexed #(if (= image (:image %2)) %1) @snapshot-list))]
    (reset! snapshot-index
      (if (pos? starting-index)
        starting-index

;;------------------------------------------------------------------------------

(defn on-snapshot-list-change [_ _ _ snapshot-list]
  (let [start-date (js/Date. (.-time (last snapshot-list)))
        end-date (js/Date. (.-time (first snapshot-list)))
        datepicker-el ($ "#datepicker")]
    (.datepicker datepicker-el "remove")
    (.datepicker datepicker-el
