Skip to content
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

Deserializing Interval discards timezone information #104

Closed
Woodz opened this issue Sep 20, 2018 · 2 comments · Fixed by #109
Closed

Deserializing Interval discards timezone information #104

Woodz opened this issue Sep 20, 2018 · 2 comments · Fixed by #109
Milestone

Comments

@Woodz
Copy link
Contributor

Woodz commented Sep 20, 2018

  • Version: jackson-datatype-joda v2.9.5
  • Dependencies:
    • play-json_2.11-2.4.3
    • joda-time-2.10
  • Repro: play.libs.Json.fromJson(new TextNode("2001-01-01T01:01:01.000+06:00/2001-01-01T01:01:02.000+06:00"), org.joda.time.Interval.class)
  • Expected: 2001-01-01T01:01:01.000+06:00/2001-01-01T01:01:02.000+06:00
  • Actual: 2000-12-31T19:01:01.000Z/2000-12-31T19:01:02.000Z
@Xyaren
Copy link

Xyaren commented Sep 24, 2018

The same Happenes with DateTime....

@cowtowncoder
Copy link
Member

As per my notes on PR, this would require updating minimum required Joda version to 2.9.
While not unreasonable (2.9 has been out for 4 years now), it needs to go in a new minor version, I think (as a general rule).

I send a note on jackson-dev mailing list, asking if anyone knew of potential issues, but assuming none reported, I can and will merge this for 2.11 branch.

@cowtowncoder cowtowncoder added this to the 2.11.0 milestone Oct 5, 2019
cowtowncoder pushed a commit that referenced this issue Oct 5, 2019
Change `IntervalDeserializer` to use `Interval.parseWithOffset` and
override timezone only if `shouldAdjustToContextTimeZone` is set or
explicit timezone is specified in the format
Add unit tests for `IntervalDeserializer` to cover the 3 scenarios:
- Timezone explicitly provided in deserialization format
- Context timezone enabled
- Neither context timezone enabled nor explicit timezone provided
Resolve: #104
cowtowncoder pushed a commit that referenced this issue Oct 5, 2019
Change `IntervalDeserializer` to use `Interval.parseWithOffset` and
override timezone only if `shouldAdjustToContextTimeZone` is set or
explicit timezone is specified in the format
Add unit tests for `IntervalDeserializer` to cover the 3 scenarios:
- Timezone explicitly provided in deserialization format
- Context timezone enabled
- Neither context timezone enabled nor explicit timezone provided
Resolve: #104
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants