-
Notifications
You must be signed in to change notification settings - Fork 910
Use RFC 822 format for marshalling date shapes #3452
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
Use RFC 822 format for marshalling date shapes #3452
Conversation
.appendLiteral(' ') | ||
.appendOffset("+HHMM", "GMT") | ||
.toFormatter() | ||
.withLocale(Locale.US); |
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.
- I guess the reason for Locale.US is V1-refernce, correct me if I am wrong.
- Why are we not doing
toFormatter(ResolverStyle.SMART, IsoChronology.INSTANCE)
same as done in RFC_1123_DATE_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.
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.
I guess an alternative would be to set the ResolverStye.SMART
and IsoChonology.INSTANCE
values on the DateTimeFormatter
object after it's been built. Let me know if you'd prefer me to make that change.
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.
Yeap , we can set it after its been built.
Can we add some test cases where we can test this too (ResolverStye and IsoChonology)?
We can compare the same with RFC_1123_DATE_TIME
Kudos, SonarCloud Quality Gate passed! |
Add utility method so that dates are marshalled using RFC 822 format.
Motivation and Context
The formatted representation of dates with single-digit day of month also includes a single-digit. This code fix will change the representation to two-digit day of month.
Current:
Expected:
Modifications
Modified DateUtils.java to add parse and format methods specific to RFC 822. Cascaded these changes to other modules.
Testing
Screenshots (if appropriate)
Types of changes
Checklist
mvn install
succeedsscripts/new-change
script and following the instructions. Commit the new file created by the script in.changes/next-release
with your changes.License