lukaszlenart commented on code in PR #532:
URL: https://github.com/apache/struts/pull/532#discussion_r873696244
##########
core/src/main/java/com/opensymphony/xwork2/conversion/impl/DateConverter.java:
##########
@@ -156,20 +192,37 @@ private DateFormat[] getDateFormats(ActionContext
context, Locale locale) {
DateFormat d2 = DateFormat.getDateInstance(DateFormat.MEDIUM, locale);
DateFormat d3 = DateFormat.getDateInstance(DateFormat.LONG, locale);
- DateFormat rfc3339 = new
SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss");
+ DateFormat rfc3339 = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss");
DateFormat rfc3339dateOnly = new SimpleDateFormat("yyyy-MM-dd");
final DateFormat[] dateFormats;
if (globalDateFormat == null) {
- dateFormats = new DateFormat[]{dt1, dt2, dt3, rfc3339, d1, d2, d3,
rfc3339dateOnly};
+ dateFormats = new DateFormat[] { dt1, dt2, dt3, rfc3339, d1, d2,
d3, rfc3339dateOnly };
} else {
- dateFormats = new DateFormat[]{globalDateFormat, dt1, dt2, dt3,
rfc3339, d1, d2, d3, rfc3339dateOnly};
+ dateFormats = new DateFormat[] { globalDateFormat, dt1, dt2, dt3,
rfc3339, d1, d2, d3, rfc3339dateOnly };
}
return dateFormats;
}
+ /**
+ * Retrieves the list of date time formats to be used when converting dates
+ *
+ * @param context the current ActionContext
+ * @param locale the current locale of the action
+ *
+ * @return a list of DateTimeFormatter to be used for date conversion
+ */
+ private DateTimeFormatter[] getDateTimeFormats(ActionContext context,
Locale locale) {
Review Comment:
Can this be `protected` to allow override?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]