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

hammock.hi.platformspecific.scala Maven / Gradle / Ivy

The newest version!
package hammock
package hi

import java.time.ZonedDateTime
import scalajs.js.{Date => JsDate}

object platformspecific {
  def convert(d: ZonedDateTime): JsDate = new JsDate(d.toInstant.toEpochMilli.toDouble)

  implicit object JSDateFormatter extends DateFormatter {
    def format(date: ZonedDateTime): String = fmt(convert(date))

    def fmt(date: JsDate): String = date.toUTCString
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy