Re: [play-framework] Re: Default stringy JSON format for joda.time.DateTime is "YYYY-MM-DD"

88 views
Skip to first unread message

Greg Methvin

unread,
Aug 10, 2015, 4:52:30 PM8/10/15
to play-framework, play-fram...@googlegroups.com
Adding the dev list.

I would definitely consider this a bug. If we're going to parse strings, we should parse full ISO-8601 strings, and perhaps abbreviated versions as well. I propose we change this to a behavior similar to DateTime.parse, since this parses plain dates as well as full datetime strings, so it's mostly backwards compatible with the current implementation.

We should consider migrating to the JSR-310 types internally in Play 3.0 and recommending using java.time._ types in the documentation. It seems like the Reads/Writes implementations we have for those are pretty reasonable. We just need to make sure we add support for those types in other parts of the APIs

I would also prefer the default DateTime writes to write a string (ISO-8610 date) rather than a number, but I'm concerned that change could break a lot of people's code. What do people think about changing this in 3.0? Ultimately we should make the reads/writes for the Joda types line up with their JSR-310 counterparts as much as possible.

On Tue, Aug 4, 2015 at 6:18 AM, Claudio <claudi...@googlemail.com> wrote:
On Monday, July 13, 2015 at 9:39:23 PM UTC+2, Dale Wijnand wrote:
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.

Play 2.4.x already depends on Java 8 (see Java 8 support). And there already are default Reads/Writes for java.time._ types. So you could migrate from Joda-Time to JSR-310 today.

But, currently at least the implementation in 2.4.2 for java.time.Instant Reads/Writes is buggy and I'm trying to get this fixed. So, maybe you want to join the discussion here: https://groups.google.com/forum/#!topic/play-framework/VFMTGPCW7Hc

-- 
Claudio

--
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.

For more options, visit https://groups.google.com/d/optout.

Jean Helou

unread,
Sep 3, 2015, 10:01:09 AM9/3/15
to Greg Methvin, play-framework, play-fram...@googlegroups.com
+1

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.
Reply all
Reply to author
Forward
0 new messages