Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
JodaSupport ActiveRecord
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