Benas
Benas

Reputation: 2332

<p:calendar. On locale change selected date pattern doesn't change

After calendar value is selected I get selected date in the current locale format, then I change locale but selected date value format remains the same and is based on the previous locale.

<p:calendar id="tl" locale="#{sessionMngr.locale}"/>

When locale is changed all translations are changed accordingly, however date format doens't change.

[Solved]

Edit ------------------------------------------------

I got answer from the official primefaces forum

http://forum.primefaces.org/viewtopic.php?f=3&t=34013

So basically I just fully update page: window.location.reload(true);

<p:commandLink actionListener="#{mngr.doChangeLocale}" oncomplete="window.location.reload(true);"/>

Upvotes: 2

Views: 1338

Answers (1)

Mr.J4mes
Mr.J4mes

Reputation: 9266

Check out this wiki post regarding PrimeFaces's locale for <p:calendar> and <p:schedule>. Basically, you need to include the localized labels in the master template so that PrimeFaces can use them to display correctly.

Upvotes: 1

Related Questions