Author: nbelaevski
Date: 2009-04-06 15:53:16 -0400 (Mon, 06 Apr 2009)
New Revision: 13398
Modified:
trunk/ui/calendar/src/main/java/org/richfaces/renderkit/CalendarRendererBase.java
Log:
https://jira.jboss.org/jira/browse/RF-6723
Modified:
trunk/ui/calendar/src/main/java/org/richfaces/renderkit/CalendarRendererBase.java
===================================================================
---
trunk/ui/calendar/src/main/java/org/richfaces/renderkit/CalendarRendererBase.java 2009-04-06
18:44:32 UTC (rev 13397)
+++
trunk/ui/calendar/src/main/java/org/richfaces/renderkit/CalendarRendererBase.java 2009-04-06
19:53:16 UTC (rev 13398)
@@ -34,6 +34,7 @@
import java.util.MissingResourceException;
import java.util.ResourceBundle;
import java.util.Set;
+import java.util.TimeZone;
import javax.el.ValueExpression;
import javax.faces.application.Application;
@@ -626,7 +627,7 @@
Object value = calendar.getValue();
date = calendar.getAsDate(value);
if(date != null) {
- returnValue = formatSelectedDate(date);
+ returnValue = formatSelectedDate(calendar.getTimeZone(), date);
}
}
return ScriptUtils.toScript(returnValue);
@@ -643,8 +644,9 @@
return result;
}
- public static Object formatSelectedDate(Date date) {
+ public static Object formatSelectedDate(TimeZone timeZone, Date date) {
Calendar calendar = Calendar.getInstance();
+ calendar.setTimeZone(timeZone);
calendar.setTime(date);
JSFunction result = new JSFunction("new Date");
result.addParameter(Integer.valueOf(calendar.get(Calendar.YEAR)));