                                             :autoclose true })
           (.. $input-element datepicker
               (on "changeDate"
-                  #((or (:onChangeDate data)
-                        identity) %)))
+                  (fn [event]
+                    (let [instant (js/JSJoda.Instant.ofEpochMilli
+                                    (.. event -date getTime))
+
+                          new-date
+                          (.toString (js/JSJoda.LocalDate.ofInstant instant))]
+                      ((:onChangeDate data identity) new-date)))))
           (. $show-btn on "click" #(.datepicker $input-element "show"))))
 
       om/IWillUnmount

            (dom/i
              #js {:className "glyphicon glyphicon-calendar"})))))))

(defn render-state
  [for-state]
  (let [{:keys [input-entry
                dispatch!
                ]} for-state

    [alibi.entry-page-state :as state :refer [validate-form]]))

(defn parse-float [v] (js/parseFloat v))

(defn active-errors
  [for-state]
  (let [{:keys [input-entry]} for-state
        {:keys [formWasSubmitted]} input-entry]
    (seq (when formWasSubmitted
           (validate-form input-entry)))))

(defn summary-errors
  [for-state]
  (let [{:keys [input-entry]} for-state
        {:keys [formWasSubmitted submit-time-state]} input-entry]
    (seq (when formWasSubmitted
           (validate-form submit-time-state)))))

(defn on-form-submit [entry on-error event]
  (log "submit")
