Remove deprecated joda time #173
Merged
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.
Description
Attempt to remove deprecated joda-time library and replace it with java-time.
closes #152
Changes:
joda.time.LocalDatewithjava.time.LocalDatejoda.time.YearMonthwithjava.time.YearMonthjoda.time.format.DateTimeFormatterwithjava.time.format.DateTimeFormatterjoda.time.DateTimewithjava.time.ZonedDateTimecom.fasterxml.jackson.datatype.jsr310.JavaTimeModulefor time serialization and deserializationcom.fasterxml.jackson.datatype.jsr310.ser.LocalDateSerializeras aLocalDateTimeserializerBackward Compatibility:
To ensure backward compatibility from Joda-time to Java-time:
2024-07-01T12:46:25.000Z2024-07-01T12:46:25ZSince the milliseconds are missing and
ZonedDateTimeis a final non-immutable class that can't be extended/overridden as intended to obtain the proper format of the string date, it was decided to leave the formatting up to the integrator to ensure the maximum backward compatible migration.Joda-time also had some utility functions like
getAsText()which is not available in Java-time, so you will receive the year/month/day as anintif you previously accessed them. If you want to format the receivedZonedDateTimeinto the same string format as that of Joda-time, you can use the following formatter:If your integration depends heavily on this formatting, you can create a utility class that would allow you to parse the date to the desired format and still access the zonedDateTime variable:
And use it like this: