Use org.joda.time.DateTime to handle datetime objects#26
Open
Use org.joda.time.DateTime to handle datetime objects#26
Conversation
Codecov Report
@@ Coverage Diff @@
## master #26 +/- ##
============================================
+ Coverage 49.73% 49.82% +0.08%
- Complexity 143 145 +2
============================================
Files 19 21 +2
Lines 575 584 +9
Branches 25 27 +2
============================================
+ Hits 286 291 +5
- Misses 270 273 +3
- Partials 19 20 +1
Continue to review full report at Codecov.
|
All datetime fields in the models are now parsed to `org.joda.time.DateTime` in UTC. This is set as a convention to avoid any inconsistencies in the timezone sent in the v2 API. `DateTimeUtils.parseISODateTimeString` will automatically detect the timezone in datetime string and return a `DateTime` object, given that the string is in ISO8601 format. Signed-off-by: Abeer <abeer.u@instamojo.com>
55a4a83 to
acc0e7f
Compare
|
Any reason we prefer joda over java 8 time modules? |
Member
|
As of now, this library supports Java 7 also, so we couldn't use the Java 8 time module. |
|
source compatibility states 1.8, wouldn't that lead to the same target compatibility? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
All datetime fields in the models are now parsed to
org.joda.time.DateTimein UTC. This is set as a convention to avoid any inconsistencies in the timezone sent in the v2 API.DateTimeUtils.parseISODateTimeStringwill automatically detect the timezone in datetime string and return aDateTimeobject, given that the string is in ISO8601 format.Signed-off-by: Abeer abeer.u@instamojo.com