 (def ^:dynamic *attribute-generators* attribute-generators)
 
 (defn texify-validity [validity]
-  (tf/unparse date-time-formatter validity))
+  (tf/unparse date-time-formatter (to-date-time validity)))
 
 (defn new-feature [collection id]
   {:_action     "new"


(defn generate-smile [obj]
  (let [baos (ByteArrayOutputStream.)]
    (.toByteArray (generate-smile-stream obj baos))))


(defn texify-feature [feature]
  (walk/postwalk
    (fn [e]
      (cond (instance? LocalDateTime e)
            (texify-moment e)
            (instance? LocalDate e)
            (texify-date e)
            (and (instance? MapEntry e) (= :_validity (first e)))
            (MapEntry. :_validity (texify-validity (second e)))
            :else e))
    feature))


               (doto smile-generator
                 (.writeStartArray 2)
                 (.writeString "D")
                 (.writeNumber ^long (to-long c))
                 (.writeEndArray))))
(add-encoder LocalDateTime
             (fn [c ^SmileGenerator smile-generator]
               (doto smile-generator
                 (.writeStartArray 2)
                 (.writeString "M")
                 (.writeNumber ^long (to-long c))
                 (.writeEndArray))))

(defn random-json-features [out-stream dataset collection total & args]
