Add (optional) conversion protocol extension to support Joda Time types
Much like we already do with clojure.data.json.
This commit is contained in:
parent
d966fabd3e
commit
cae818f646
1 changed files with 12 additions and 0 deletions
12
src/monger/joda_time.clj
Normal file
12
src/monger/joda_time.clj
Normal file
|
|
@ -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))))
|
||||
Loading…
Reference in a new issue