From cae818f646c0d690bf1fe11c2a22a66096c84683 Mon Sep 17 00:00:00 2001 From: "Michael S. Klishin" Date: Thu, 13 Oct 2011 18:04:49 +0400 Subject: [PATCH] Add (optional) conversion protocol extension to support Joda Time types Much like we already do with clojure.data.json. --- src/monger/joda_time.clj | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 src/monger/joda_time.clj diff --git a/src/monger/joda_time.clj b/src/monger/joda_time.clj new file mode 100644 index 0000000..ceae374 --- /dev/null +++ b/src/monger/joda_time.clj @@ -0,0 +1,12 @@ +(ns monger.joda-time + (:import (org.joda.time DateTime DateTimeZone)) + (:use [monger.conversion])) + +;; +;; API +;; + +(extend-protocol ConvertToDBObject + org.joda.time.DateTime + (to-db-object [^org.joda.time.DateTime input] + (to-db-object (.toDate input))))