julman99 / gson-fire

A java library that adds some very useful features to Gson, like Date serializing to unix timestamp or RFC3339, method (getters) serialization, pre/post processors and many others. Check out the documentation to learn how to use it!
http://gsonfire.io
Other
229 stars 37 forks source link

Support RFC3339 full-date #19

Closed WonderCsabo closed 9 years ago

WonderCsabo commented 9 years ago

The standard supports a full-date format, which only contains date information, and does not have any time and timezone information. Currently the date serialiser rejects dates coming in this format. It would be also nice to add an option to the deserializer to only use full-date and not emit any time information, so consumers can accept the generated string even if they strictly only use the full-date part.

This full-date format is used by lots of frameworks like Swagger as default date type. Currently GSON Fire cannot work with them, because it expects and generates date-time.

BTW, full-time support can be also added, but that is less used.

julman99 commented 9 years ago

Thanks for the suggestion. Do you expect these values to be serialized from-to java.util.Date?

WonderCsabo commented 9 years ago

Yes.

julman99 commented 9 years ago

Ok great I will work on this during the weekend

julman99 commented 9 years ago

I've been working on this. I have the part that can parse a date with our without the time. The second part, (serializing only the date portion) will be done during the week. The next version of GsonFire will include this feature and will be released at the most on Oct 12th.

WonderCsabo commented 9 years ago

Great, thanks!

julman99 commented 9 years ago

Done and deployed in version 1.4.0. See the DateSerializationPolicy

WonderCsabo commented 9 years ago

Great, thanks!