0

I am currently using a object containing a BSONDateTime :

case class Datez(date: BSONDateTime)

When this a list of Datez object is transformed to json the following string is generated :

[{"date":{"$date":1408053600000}}, {"date":{"$date":1321052400000}}]

But what I am expecting client side is the following :

[{"date":1408053600000}, {"date":1321052400000}]

To do so I a using play.api.libs.json.Json :

implicit val datezFormat = Json.format[Datez]
Json.arr(List(Datez...))

How can I get rid of the "$date" part with the smallest impact to the server side code ?

PS : I am doing this to ease angular compatibility but their is maybe another way.

Manuel Leduc
  • 1,849
  • 3
  • 23
  • 39

0 Answers0