Last active
August 29, 2015 14:19
-
-
Save mediavrog/a619df2945c11163112f to your computer and use it in GitHub Desktop.
JodaSupport ActiveRecord
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val jodaDateTimeConverter = new FormConverter[DateTime] { | |
override def serialize(v: Any): String = | |
new DateTime(v).toString(ISODateTimeFormat.dateHourMinuteSecond) | |
override def deserialize(s: String): DateTime = | |
new DateTime(s.toLong) | |
} | |
FormConverter.register(classOf[DateTime], jodaDateTimeConverter) | |
ClassInfo.factories.register(classOf[DateTime], {() => DateTime.now.asInstanceOf[AnyRef]}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment