Page 1 of 1

Schedule and Timezone problem

Posted: 03 Dec 2010, 08:33
by bardu
My production server stays in a different timezone, however, the time difference is only two hours.

The problem is that events on my local development machine appear in the correct day in the schedule component. If I access the schedule component on the production server all events are one day earlier displayed.

Can't get way? :(

Re: Schedule and Timezone problem

Posted: 03 Dec 2010, 08:46
by kman
if it's fine for your web application to follow the Web Server's system TimeZone where it deployed, add the following code to your Deployment Descriptor web.xml:

Code: Select all

<context-param>
    <param-name>javax.faces.DATETIMECONVERTER_DEFAULT_TIMEZONE_IS_SYSTEM_TIMEZONE</param-name>
    <param-value>true</param-value>
</context-param>

Re: Schedule and Timezone problem

Posted: 03 Dec 2010, 08:53
by bardu
Thanks for your quick response.

Actually, I need to have my local timezone as the default, can I set this via <context-param> too?

Stephan

Re: Schedule and Timezone problem

Posted: 03 Dec 2010, 10:22
by kman
yes, as long as you can access it at your Bean, for example

web.xml:

Code: Select all

<context-param>
    <param-name>FIXED_LOCAL_TIMEZONE</param-name>
    <param-value>GMT+08:00</param-value>
</context-param>
map calendar component's timezone attribute to a bean's value, like this:

Code: Select all

timezone="#{myGlobalBean.localTimeZone}"
myGlobalBean:

Code: Select all

public String getLocalTimeZone()
{
    return FacesContext.getCurrentInstance().getExternalContext().getInitParameter( "FIXED_LOCAL_TIMEZONE" );
}

Re: Schedule and Timezone problem

Posted: 03 Dec 2010, 18:03
by bardu
Thanks will try this later the day.

However, we have spoken about schedule and schedule doesn't has a timezone property.

Re: Schedule and Timezone problem

Posted: 06 Dec 2010, 23:07
by bardu
I contribute this misbehavior to a bug in <p:schedule> component, which for I just created an issue.

http://code.google.com/p/primefaces/iss ... il?id=1540

This bug can also be reproduced in PF Showcase.