Author: pyaschenko
Date: 2011-01-25 09:32:39 -0500 (Tue, 25 Jan 2011)
New Revision: 21207
Modified:
trunk/examples/input-demo/src/main/java/org/richfaces/demo/CalendarBean.java
trunk/examples/input-demo/src/main/webapp/examples/calendar.xhtml
trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/CalendarRendererBase.java
Log:
http://jira.jboss.com/jira/browse/RF-10085
Modified: trunk/examples/input-demo/src/main/java/org/richfaces/demo/CalendarBean.java
===================================================================
---
trunk/examples/input-demo/src/main/java/org/richfaces/demo/CalendarBean.java 2011-01-25
14:22:24 UTC (rev 21206)
+++
trunk/examples/input-demo/src/main/java/org/richfaces/demo/CalendarBean.java 2011-01-25
14:32:39 UTC (rev 21207)
@@ -2,6 +2,7 @@
import java.util.Date;
import java.util.Locale;
+import java.util.TimeZone;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;
@@ -26,6 +27,7 @@
private int horizontalOffset = 0;
private int verticalOffset = 0;
private Positioning[] positioningValues = Positioning.values();
+ private TimeZone timeZone = TimeZone.getTimeZone("EST");
public CalendarBean() {
@@ -143,4 +145,12 @@
public Positioning[] getPositioningValues() {
return positioningValues;
}
+
+ public void setTimeZone(TimeZone timeZone) {
+ this.timeZone = timeZone;
+ }
+
+ public TimeZone getTimeZone() {
+ return timeZone;
+ }
}
\ No newline at end of file
Modified: trunk/examples/input-demo/src/main/webapp/examples/calendar.xhtml
===================================================================
--- trunk/examples/input-demo/src/main/webapp/examples/calendar.xhtml 2011-01-25 14:22:24
UTC (rev 21206)
+++ trunk/examples/input-demo/src/main/webapp/examples/calendar.xhtml 2011-01-25 14:32:39
UTC (rev 21207)
@@ -65,7 +65,7 @@
ondatemouseover="return onEvent.call(this, event);"
firstWeekDay="4"
horizontalOffset="#{calendarBean.horizontalOffset}"
- verticalOffset="#{calendarBean.verticalOffset}"
defaultTime="11:22:01"
+ verticalOffset="#{calendarBean.verticalOffset}"
defaultTime="21:22:01" timeZone="#{calendarBean.timeZone}"
valueChangeListener="#{calendarBean.doValueChangeListener}"
currentDataChangeListener="#{calendarBean.doCurrentDataChangeListener}"
onbeforedateselect="myFunction(event)"
Modified:
trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/CalendarRendererBase.java
===================================================================
---
trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/CalendarRendererBase.java 2011-01-25
14:22:24 UTC (rev 21206)
+++
trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/CalendarRendererBase.java 2011-01-25
14:32:39 UTC (rev 21207)
@@ -402,7 +402,7 @@
Date date = CalendarHelper.getFormattedDefaultTime(abstractCalendar);
Map<String, Object> result = new HashMap<String, Object>();
if (date != null) {
- Calendar calendar = CalendarHelper.getCalendar(facesContext,
abstractCalendar);
+ Calendar calendar = CalendarHelper.getCalendar(null, null);
calendar.setTime(date);
int hours = calendar.get(Calendar.HOUR_OF_DAY);
int minutes = calendar.get(Calendar.MINUTE);