      (om/build pages-list (:pages document)
                {:state state})]))
 
-(ui/defcomponent ^:private meta-pane [document owner]
+(ui/defcomponent ^:private date-picker [{:keys [document_date]} owner]
+  (render-state [_ {:keys [date value]}]
+    [:input {:type "date"
+             :value value
+             :on-change (fn [e] (do
+                                  (om/set-state! owner :value e.target.value)
+                                  (async/put! date e.target.value)))}]))
+
+(ui/defcomponent ^:private meta-pane [{:keys [document_date] :as document} owner]
   (render [_]
     [:.sidebar
      [:header "Meta"]

                                       :add data/add-tags
                                       :remove data/remove-tags)
                             [tag])
                  (api/update-document!))))
          (recur)))))
  (render-state [_ state] 
    (let [{:keys [page-number]} state
          page-events (:pages state)
          tag-changes (:tag-changes state)
          sidebars (om/observe owner (data/ui-sidebars))
          current-page (nth (:pages (om/value document))
                            (dec (or page-number 1)))]

       (om/build tags/tags-input document
                 {:state (om/get-state owner)})]

      (let [formatter (DateTimeFormat. "yyyy-MM-dd")]
        (om/build date-picker document
                  {:init-state {:value (when document_date
                                         (.format formatter document_date))}
                   :state (om/get-state owner)}))
      
      ;; Buttons: Download, Delete, etc.
      [:.buttons
       [:button.download {:on-click #(js/window.open
