0

I am working on an application whose target will be the greek market. My problem is that I want the date input fields to have the greek date format (which is dd-mm-yyyy) and the calendar to be in greek regardless of the browser settings. I suspect that there is some way to achieve this using the Locale attribute of either the Session, or the input field, in order to avoid using some 3rd party plugin (like the jQuery datepicker). Am I correct in thinking so? And if yes, what is the proper way to do this?

What I tried to do was setLocale("el") when initiating the input field and when creating a new session, both of which did not work out.

1

1 Answer 1

0

Override Application#newSession:

@Override
public Session newSession(Request request, Response response)
{
    final Session session = super.newSession(request, response);
    session.setLocale(yourFixedLocale);
    return session;
}
2
  • did that, didn't work. MySession extends the WicketBootSecuredWebApplication class, but I don't think the problem lies in there. Am I doing it wrong? final MySession session = new MySession(request); session.setLocale(new Locale("el","GR")); return session; Commented Jan 18, 2023 at 23:46
  • Are you sure that your Session extends an Application ? This would be wrong!
    – martin-g
    Commented Jan 19, 2023 at 6:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.