Although joda.time.DateTime can have precision information of hours, minutes, seconds etc the only acceptable default JSON formats for it in play-json are unix timestamps (longs) and YYYY-MM-DD. See these lines of code which make it impossible to specify minutes/hours etc in a string-based format.
This bad pattern probably came from the method itself being incorrectly named here - it should be def jodaDateTimeReads instead of def jodaDateReads since it returns Reads[joda.time.DateTime] and notReads[joda.time.Date]
Reads[joda.time.DateTime]s should use the ISODateTimeFormat.dateTimeParser instead of specifying an explicit pattern. This strategy was correctly used for Reads[joda.time.LocalDate] which correctly falls back to the ISODateTimeFormat.localDateParser when an explicit pattern is not specified.
I understand, I can always create my own implicit and use it but it makes things harder when I am relying on external macro libraries like metarest or this which rely on the default Readers
I also feel this pain. I'm hoping that this can be a breaking change with Play 3.0. Perhaps if 3.0 is Java 8+ then it could provide Reads/Writes for java.time that return ISO-8601 format.
--
You received this message because you are subscribed to a topic in the Google Groups "play-framework" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/play-framework/vofrDXZqpTI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to play-framewor...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/play-framework/4418b94a-e805-4e72-839a-3136620099ea%40googlegroups.com.
You received this message because you are subscribed to the Google Groups "Play framework dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to play-framework-...@googlegroups.com.