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.LocalDate
withjava.time.LocalDate
joda.time.YearMonth
withjava.time.YearMonth
joda.time.format.DateTimeFormatter
withjava.time.format.DateTimeFormatter
joda.time.DateTime
withjava.time.ZonedDateTime
com.fasterxml.jackson.datatype.jsr310.JavaTimeModule
for time serialization and deserializationcom.fasterxml.jackson.datatype.jsr310.ser.LocalDateSerializer
as aLocalDateTime
serializerBackward Compatibility:
To ensure backward compatibility from Joda-time to Java-time:
2024-07-01T12:46:25.000Z
2024-07-01T12:46:25Z
Since the milliseconds are missing and
ZonedDateTime
is 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 anint
if you previously accessed them. If you want to format the receivedZonedDateTime
into 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: