Schedule and Timezone problem

UI Components for JSF
Post Reply
User avatar
bardu
Posts: 293
Joined: 30 Dec 2009, 08:27
Location: Canada

03 Dec 2010, 08:33

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

kman
Posts: 57
Joined: 03 Nov 2010, 09:21
Location: Hong Kong

03 Dec 2010, 08:46

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>
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

User avatar
bardu
Posts: 293
Joined: 30 Dec 2009, 08:27
Location: Canada

03 Dec 2010, 08:53

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

kman
Posts: 57
Joined: 03 Nov 2010, 09:21
Location: Hong Kong

03 Dec 2010, 10:22

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" );
}
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

User avatar
bardu
Posts: 293
Joined: 30 Dec 2009, 08:27
Location: Canada

03 Dec 2010, 18:03

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

User avatar
bardu
Posts: 293
Joined: 30 Dec 2009, 08:27
Location: Canada

06 Dec 2010, 23:07

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

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 22 guests