jsf 2 - PrimeFaces calendar change pattern after date selection -


i use primefaces calendar component on page. pattern attribute set mm/dd/yyyy hh:mm:ss. component value attribute linked java.util.date variable in bean. when open page date in format expect, after change of value, format change different format.

expected format - 06/15/2015 08:00:30

format after change of value - 06/15/2015 8:00 am

component ussage.

<p:calendar value="#{somebean.somejava.utildatevariable}" pattern="mm/dd/yyyy hh:mm:ss" locale="en">      <f:convertdatetime pattern="mm/dd/yyyy hh:mm:ss"/> </p:calendar> 

i tried check primefaces showcase , documentation, different locale specification , usage of localization script current localization no effect.

every suggestion welcome.

you not need <f:convertdatetime pattern="mm/dd/yyyy hh:mm:ss"/>. tag converts string object , viceversa.

the primefaces documentation uses pattern attribute , locale attribute causes troubles. try:

<p:calendar value="#{somebean.somejava.utildatevariable}" pattern="mm/dd/yyyy hh:mm:ss"/> 

Comments

Popular posts from this blog

javascript - Google App Script ContentService downloadAsFile not working -

javascript - Function overwritting -

php - Find a regex to take part of Email -