-
Notifications
You must be signed in to change notification settings - Fork 205
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change Calendar Deserializer to accepts json object format #547
Conversation
{"time":1301886000000,"timezone":"America/Sao_Paulo"} Add test to validate this format
Calendar instance
Long time = value.get("time").getAsLong(); | ||
|
||
calendar.setTimeZone(TimeZone.getTimeZone(timezone)); | ||
calendar.setTimeInMillis(time); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
weird indent here
I think that we need to accept ISO8601 format as described in #544, since this ISO is a standard. |
Humm.. I'll take a closer look at it |
Adopt ISO8601 format will generate a compatibility break, because it's easy to adopt various formats to deserialize, but must be chosen only one format to serialize. |
More details: |
doesn't have time and timezone properties and if these values are invalid
@garcia-jj The RFC 822 standart support time zones like: "GMT", "GMT-03:00" and "-0300" Sees the differences? The only similarity is the format "-0300". So.. the only String date that works in the pattern Full support to the ISO8601 standard must support the patterns: |
Understood. So I think that we can postpone this pattern to later. Thank you. |
Thanks! |
The Calendar Serializer produces a json like this:
{"time":1301886000000,"timezone":"America/Sao_Paulo"}
But the Calendar Deserializer ignore this format.
This Calendar Deserializer fix the problem and check if json is a primitive or object before parsing it.