Author: nbelaevski
Date: 2007-07-31 22:51:57 -0400 (Tue, 31 Jul 2007)
New Revision: 1970
Modified:
trunk/sandbox/ui/calendar/src/main/java/org/richfaces/component/UICalendar.java
trunk/sandbox/ui/calendar/src/main/java/org/richfaces/renderkit/CalendarRendererBase.java
Log:
- A4J is back in sample
- Month scrolling fixed
- TODO for Kaa added
Modified: trunk/sandbox/ui/calendar/src/main/java/org/richfaces/component/UICalendar.java
===================================================================
---
trunk/sandbox/ui/calendar/src/main/java/org/richfaces/component/UICalendar.java 2007-08-01
01:50:16 UTC (rev 1969)
+++
trunk/sandbox/ui/calendar/src/main/java/org/richfaces/component/UICalendar.java 2007-08-01
02:51:57 UTC (rev 1970)
@@ -246,6 +246,21 @@
return TimeZone.getDefault();
}
+ public Date convertCurrentDate(String currentDateString) {
+
+ Calendar calendar = Calendar.getInstance();
+ calendar.clear();
+ calendar.set(Calendar.DATE, 1);
+ int idx = currentDateString.indexOf('/');
+ calendar.set(Calendar.MONTH, Integer.parseInt(currentDateString
+ .substring(0, idx)) - 1);
+ calendar.set(Calendar.YEAR, Integer.parseInt(currentDateString
+ .substring(idx + 1)));
+
+ return calendar.getTime();
+
+ }
+
public void broadcast(FacesEvent event) throws AbortProcessingException {
// TODO Auto-generated method stub
if (event instanceof AjaxEvent) {
@@ -271,8 +286,11 @@
// org.richfaces.renderkit.CalendarRendererBase.convertCurrentDate(String)
// method
// for more
- Date currentDate = getConvertedValue(facesContext,
- currentDateString);
+
+ //TODO nick - kaa - throw exception and review resulting message :)
+ //throw new NullPointerException();
+
+ Date currentDate = convertCurrentDate(currentDateString);
CurrentDateChangeEvent newDateChangeEvent = new CurrentDateChangeEvent(
this, currentDate);
newDateChangeEvent.queue();
Modified:
trunk/sandbox/ui/calendar/src/main/java/org/richfaces/renderkit/CalendarRendererBase.java
===================================================================
---
trunk/sandbox/ui/calendar/src/main/java/org/richfaces/renderkit/CalendarRendererBase.java 2007-08-01
01:50:16 UTC (rev 1969)
+++
trunk/sandbox/ui/calendar/src/main/java/org/richfaces/renderkit/CalendarRendererBase.java 2007-08-01
02:51:57 UTC (rev 1970)
@@ -104,21 +104,6 @@
(String) submittedValue);
}
- public Date convertCurrentDate(String currentDateString) {
-
- Calendar calendar = Calendar.getInstance();
- calendar.clear();
- calendar.set(Calendar.DATE, 1);
- int idx = currentDateString.indexOf('/');
- calendar.set(Calendar.MONTH, Integer.parseInt(currentDateString
- .substring(0, idx)));
- calendar.set(Calendar.YEAR, Integer.parseInt(currentDateString
- .substring(idx + 1)));
-
- return calendar.getTime();
-
- }
-
protected void doDecode(FacesContext context, UIComponent component) {
// TODO Auto-generated method stub
super.doDecode(context, component);
Show replies by date