All Downloads are FREE. Search and download functionalities are using the official Maven repository.

scalaz.dateTimeCodecs.mustache Maven / Gradle / Ivy

There is a newer version: 7.8.0
Show newest version
package {{apiPackage}}

import argonaut._
import argonaut.EncodeJson._
import argonaut.DecodeJson._

import org.http4s._
import org.http4s.{EntityDecoder, EntityEncoder}
import org.http4s.argonaut._

import org.joda.time.DateTime

object DateTimeCodecs {
  implicit def dateTimeEncodeJson: EncodeJson[DateTime] =
    EncodeJson[DateTime](dt => StringEncodeJson(dt.toString))

  implicit def dateTimeDecodeJson: DecodeJson[DateTime] =
    DecodeJson.of[String].map(DateTime.parse(_)) setName "org.joda.time.DateTime"
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy