Board index JavaServer Faces General Schedule and Timezone problem

Schedule and Timezone problem

Components, Ajax Framework, Utilities and More.

Post 03 Dec 2010, 08:33

Posts: 293
Location: Canada
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? :(
JSF-2.0, mojarra-2.1 | PrimeFaces-3.0-M1 | GFv3.1 | NetBeans 7 | Ubuntu 11.04
www.yukonlive.ca
www.yukonlive.de


Posts: 57
Location: Hong Kong
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:
<context-param>
    <param-name>javax.faces.DATETIMECONVERTER_DEFAULT_TIMEZONE_IS_SYSTEM_TIMEZONE</param-name>
    <param-value>true</param-value>
</context-param>
PrimeFaces 3.0M1, Sun Mojarra 2.0.4 FCS, Sun GlassFish JSTL 1.2,
Apache Log4J 1.2.16, EclipseLink 2.1.1.v20100817-r8050,
Eclipse Helios


Posts: 293
Location: Canada
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
JSF-2.0, mojarra-2.1 | PrimeFaces-3.0-M1 | GFv3.1 | NetBeans 7 | Ubuntu 11.04
www.yukonlive.ca
www.yukonlive.de


Posts: 57
Location: Hong Kong
yes, as long as you can access it at your Bean, for example

web.xml:
<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:
timezone="#{myGlobalBean.localTimeZone}"

myGlobalBean:
public String getLocalTimeZone()
{
    return FacesContext.getCurrentInstance().getExternalContext().getInitParameter( "FIXED_LOCAL_TIMEZONE" );
}
PrimeFaces 3.0M1, Sun Mojarra 2.0.4 FCS, Sun GlassFish JSTL 1.2,
Apache Log4J 1.2.16, EclipseLink 2.1.1.v20100817-r8050,
Eclipse Helios


Posts: 293
Location: Canada
Thanks will try this later the day.

However, we have spoken about schedule and schedule doesn't has a timezone property.
JSF-2.0, mojarra-2.1 | PrimeFaces-3.0-M1 | GFv3.1 | NetBeans 7 | Ubuntu 11.04
www.yukonlive.ca
www.yukonlive.de


Posts: 293
Location: Canada
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.
JSF-2.0, mojarra-2.1 | PrimeFaces-3.0-M1 | GFv3.1 | NetBeans 7 | Ubuntu 11.04
www.yukonlive.ca
www.yukonlive.de


Return to General