-
FEATURED COMPONENTS
First time here? Check out the FAQ!
I have create a ZKCalendar with the following custom DateFormatter class:
public class LeaveCalendarDateFormatter implements DateFormatter {
public String getCaptionByDateOfMonth(Date date, Locale locale, TimeZone timezone) {
Calendar calThis = Calendar.getInstance(timezone, locale);
calThis.setTime(date);
String dayLetter = new SimpleDateFormat("EE").format(date).substring(0,1).toUpperCase();
return "<span class=cal-dow>" + dayLetter + "</span> <span class=cal-dom>"
+ Integer.toString(calThis.get(Calendar.DAY_OF_MONTH)) + "</span>";
}
}
This renders nicely with the day of week letters, however when I click on the day of the month, the DayClick event fires with no data:
java.lang.NumberFormatException: For input string: "null"
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48) at java.lang.Long.parseLong(Long.java:410) at java.lang.Long.parseLong(Long.java:468) at org.zkoss.calendar.event.CalendarsEvent.getLong(CalendarsEvent.java:131) at org.zkoss.calendar.event.CalendarsEvent.getClickEvent(CalendarsEvent.java:123)
I overrode the service method of Calendar to debug and the json data object on the request is NULL.
Anyone have an idea what is causing this ?? I presume it is something to do with my DateFormatter class.
Thanks for your help.
Asked: 2013-06-24 09:22:43 +0800
Seen: 15 times
Last updated: Jun 24 '13
arrow buttons are not appearing(invisible) in zk calendar
Can size of datebox picker be changed?
zkcalendar - compilation error
zk calendar: Highlight Some Event Dates [closed]
zk:calendar Highlight Some Dates
ZK Calendar nextPage() not changing month
Hi JustinFrost, when you render html in month caption, the structure of ZK calendar is changed, why do you need to render span tag in month caption?
jimmyshiau ( 2013-07-17 11:59:07 +0800 )edit