[GitHub] wicket pull request #267: Fix to use locale of the session
Github user try0 closed the pull request at: https://github.com/apache/wicket/pull/267 ---
[GitHub] wicket pull request #267: Fix to use locale of the session
Github user martin-g commented on a diff in the pull request: https://github.com/apache/wicket/pull/267#discussion_r167540897 --- Diff: wicket-core/src/main/java/org/apache/wicket/validation/validator/DateValidator.java --- @@ -186,7 +188,15 @@ protected IValidationError decorate(IValidationError error, IValidatable v // format variables if format has been specified if (format != null) { - SimpleDateFormat sdf = new SimpleDateFormat(format); + WebSession session = WebSession.get(); --- End diff -- There is no need of `Web`Session. Just `Session.get()` should be enough to get the locale. ---
[GitHub] wicket pull request #267: Fix to use locale of the session
Github user martin-g commented on a diff in the pull request: https://github.com/apache/wicket/pull/267#discussion_r167540776 --- Diff: wicket-core/src/main/java/org/apache/wicket/validation/validator/DateValidator.java --- @@ -186,7 +188,15 @@ protected IValidationError decorate(IValidationError error, IValidatable v // format variables if format has been specified if (format != null) { - SimpleDateFormat sdf = new SimpleDateFormat(format); + WebSession session = WebSession.get(); --- End diff -- First check that there is a Session with `if (Session.exists()) { ... }` because `Session.get()` will create a new one. ---
[GitHub] wicket pull request #267: Fix to use locale of the session
GitHub user try0 opened a pull request: https://github.com/apache/wicket/pull/267 Fix to use locale of the session Fix to output validation message according to locale even when format pattern contains "E". Sorry if my English is wrong. You can merge this pull request into a Git repository by running: $ git pull https://github.com/try0/wicket modifyDateValidator Alternatively you can review and apply these changes as the patch at: https://github.com/apache/wicket/pull/267.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #267 commit b822c30fd6271b654db7a08716c5e5034b5e752a Author: Ryo Date: 2018-02-12T10:10:50Z Fixed to use locale of the session Fixed to output validation message according to locale when format pattern contains "E". commit af5a25585be06c3c7c93c951c9415d015f4e670c Author: Ryo Date: 2018-02-12T10:46:32Z Revert "Fixed to use locale of the session" This reverts commit b822c30fd6271b654db7a08716c5e5034b5e752a. commit b3aad1921db7e367e0174ab03672c84cc4a6827d Author: Ryo Date: 2018-02-12T10:48:38Z Fixed to use locale of the session Fixed to output validation message according to locale when format pattern contains "E". ---