             [pepa.data :as data]
 
             [clojure.browser.event :as event])
-  (:import [goog.net XhrIo XmlHttp XmlHttpFactory EventType])
+  (:import [goog.net XhrIo XmlHttp XmlHttpFactory EventType]
+           [goog.i18n DateTimeFormat])
   (:require-macros [cljs.core.async.macros :refer [go go-loop]]))
 
 (def +xhr-timeout+ (* 5 1000))

          title (when-not (= (:title document)
                             (:title server))
                  (:title document))
          tags {:added (remove (set (:tags server)) (:tags document))
                :removed (remove (set (:tags document)) (:tags server))}]
      (when-not server

                        {:document document
                         :document/id (:id document)
                         :response server})))
      (if (or title date (seq (:added tags)) (seq (:removed tags)))
        (let [response (<! (xhr-request! (str "/documents/" (:id document))
                                         :post
                                         {:title title, :document_date date :tags tags}))]
          (if (= 200 (:status response))
            (let [new-document (-> response
                                   :response/transit
