com.malliina.json.PrimitiveFormats.scala Maven / Gradle / Ivy
The newest version!
package com.malliina.json
import io.circe._
import scala.concurrent.duration.{Duration, DurationDouble}
object PrimitiveFormats {
implicit val durationCodec: Codec[Duration] = Codec.from(
Decoder.decodeDouble.map(_.seconds),
Encoder.encodeDouble.contramap[Duration](_.toSeconds.toDouble)
)
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy