Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

primefaces calendar: wrong date entry

Using jsf 2.2.0.

For all the date, it seems to remove one day. When I click on 8 nov, it displays 11/08/2011. But then it stores Nov 7, 2011 in my Date field in my managed bean.

I live in singapore, wondering if it's an issue with the timezone.

like image 246
Foo Avatar asked Nov 06 '11 03:11

Foo


2 Answers

try adding this to your web.xml

<context-param>
    <param-name>javax.faces.DATETIMECONVERTER_DEFAULT_TIMEZONE_IS_SYSTEM_TIMEZONE</param-name>
    <param-value>true</param-value>
</context-param>
like image 163
Daniel Avatar answered Oct 20 '22 15:10

Daniel


If you are using primefaces 5, in your scheduler :

<p:schedule ...ignoreTimezone="false" />
like image 2
dannybastos Avatar answered Oct 20 '22 14:10

dannybastos