gkopff / gson-jodatime-serialisers

A set of Gson serialiser/deserialisers for dealing with Joda Time entities.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

DateTimeConverter crashes on parsing dates that have no millisecond value

roschlau opened this issue · comments

commented

When parsing a string like "2016-06-29T12:00:00+02:00" the DateTimeConverter will crash, because it uses ISODateTimeFormat.dateTime() to get a formatter that explicitely expects a millisecond value. There is an alternative that explicitely doesn't excpect a millisecond value: ISODateTimeFormat.dateTimeNoMillis().
Both versions should be supported, as both are quite common (and valid regarding ISO 8601).

commented

Thanks. Are you able to supply the PR?

commented

@gkopff I think so, yeah. Any requirements, regarding code style, unit test, anything else from your part?

commented

Just match the existing style (2 space indentation, brace position etc), and include appropriate tests please.

commented

@gkopff Thanks for merging! Can you give an estimate when an update for the library will be available through maven?

commented

It's Friday night here, so I probably won't get around to the mechanics of releasing until Monday. I'll post a note here once I've published it.

commented

Much appreciated, thanks!

commented

That's been published to Maven Central as 1.3.0.