      ^{ :key series } [series-pane series @query-window])])
 
 (defn end-edit [ text state ]
-  (reset! query-window (js/parseInt text)))
+  (when (parse-query-window text)
+    (reset! query-window text)))
 
 (defn input-field [ initial-text on-enter ]
   (let [ state (reagent/atom { :text initial-text }) ]

            [cljs-time.coerce :as time-coerce]
            [metlog-client.tsplot :as tsplot]))

(defonce query-window (reagent/atom (* 3600 24)))

(def dashboard-state (reagent/atom {:series [] :text ""}))


    channel))

(defn range-ending-at [ end-t ]
  (let [begin-t (time/minus end-t (time/seconds (parse-query-window @query-window)))]
    {:begin-t (time-coerce/to-long begin-t)
     :end-t (time-coerce/to-long end-t)}))

