How to solve the problem of date validation - calendar - PrimeFaces?

0

When loading the date in a calendar (PrimeFaces) it loads normally:

Code:

<p:outputLabel value="Data de Nascimento" for="data-nascimento" />
<p:calendar id="data-nascimento" locale="pt" mask="99/99/9999"
            value="#{solicitacaoRHBean.itemEdicao.dataNascimento}"
            required="true" navigator="true"
            requiredMessage="Data de Nascimento é obrigatório">
</p:calendar>

But at the moment of validating / persisting the information gives an error message saying that the date is not a valid date.

How to resolve this issue?

    
asked by anonymous 01.10.2015 / 01:38

1 answer

1

For locale="pt" to work, you need to add a javascript on your page, because by default , it is only in English.

Mask is just a mask, not the formatting itself. However, you can force the Brazilian standard using the attribute and value pattern="dd/MM/yyyy" .

    
02.10.2015 / 21:10