Skip to content
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

WW-4799 Adding struts.date.format as a conversion format for DateConv… #141

Closed
wants to merge 1 commit into from

Conversation

dcabasson
Copy link

…erter

&& !org.apache.struts2.components.Date.DATETAG_PROPERTY.equals(globalFormat)) {
globalDateFormat = new SimpleDateFormat(globalFormat, locale);
}
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you move this whole section into getDateFormats to avoid passing the globalDateFormat as a parameter? Also it would be good to extract this logic into a protected method to allow override, so the finally it should look like this:

     DateFormat[] dfs = getDateFormats(globalDateFormat, locale);

...

private DateFormat[] getDateFormats(Locale locale) {
    ...
    DateFormat globalDateFormat = getGlobalDateFormat();
    ...
}

protected getGlobalDateFormat() {
     // your code here
}

@lukaszlenart
Copy link
Member

I will fix the outstanding issues in another PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants