   (reify
     om/IDidMount
     (did-mount [_]
-      (let [start-element (js/$ (om/get-node owner "start-date"))
+      (let [event-channel (om/get-state owner :event-channel)
+            start-element (js/$ (om/get-node owner "start-date"))
             end-element (js/$ (om/get-node owner "end-date"))
             start-datepicker (.datepicker start-element #js {:format "yyyy-mm-dd"})
-            end-datepicker (.datepicker end-element #js {:format "yyyy-mm-dd"})]
+            end-datepicker (.datepicker end-element #js {:format "yyyy-mm-dd"})
+            format-date #(timef/unparse date-formatter (time/plus (time/date-time (.-date %))
+                                                                  (time/days 1)))]
+        (.on start-datepicker "changeDate" (fn [e]
+                                             (go (>! event-channel [:from-selected (format-date e)]))))
+        (.on end-datepicker "changeDate" (fn [e]
+                                           (go (>! event-channel [:to-selected (format-date e)]))))
         start-datepicker))
 
     om/IRenderState

                   [cljs.core.match.macros :refer [match]]))

(ws-repl/connect "ws://localhost:9001" :verbose true)

(enable-console-print!)

(let [date-formatter (timef/formatter "yyyy-MM-dd")
      end-date (time/today-at 12 00)
      start-date (time/minus end-date (time/months 1))
      end-date (timef/unparse date-formatter end-date)
      start-date (timef/unparse date-formatter start-date)]

            name->metric (zipmap (map :name metrics) metrics)
            element (om/get-node owner "metrics-selector")
            jq-element (js/$ element)]

        ; needed to clean current selection
        (.select2 jq-element #js {:placeholder ""
                                  :allowClear true})
        (.off jq-element)
        (.on jq-element "change" (fn [e]
                                   (let [selected-metric (get name->metric (.-val e))]
