Vague use of date in scala.js

I am using a java.util.Date

in an isomorphic class:

case class RendezVous(var id: Option[String], var date : Date, var lieu : String)

      

On a page that displays as

{"date$1":"2015-05-06T07:10:47.433Z"}

      

Will it help java.util.Date.scala

in this matter? And if not then how can I use Date in the jvm / js shared class

+3


source to share


1 answer


You can easily convert java.util.Date

to js.Date

:

new js.Date(d.getTime().toDouble)

      



and what he is. In the other direction:

new java.util.Date(d.getTime().toLong)

      

+5


source







All Articles