       (sync-time-with-snapshot!))))
 
 (defn click-earlier []
-  (if (>= @snapshot-index (count @snapshot-list))
+  (if (< @snapshot-index (count @snapshot-list))
     (do
       (swap! snapshot-index inc)
       (sync-time-with-snapshot!))))

  (:require-macros [hiccups.core :as hiccups])
  (:require
    [hiccups.runtime :as hiccupsrt]
    [clojure.walk]))

;;------------------------------------------------------------------------------
;; Atoms


(defn add-events []
  (aset js/window "onpopstate" on-popstate)
  (on ($ "#datepicker") "changeDate" on-datetime-change)
  (on ($ js/document) "keydown" on-keydown)

  (-> ($ "body")
