-
Type:
Bug
-
Resolution: Fixed
-
Priority:
Major
-
Affects Version/s: 2.1.2, 2.1.1
-
None
As code below, the length of the event starts at previous month is wrong (please refer to the cal_evt_issue.png attached)
<zk>
<zscript><![CDATA[
import org.zkoss.calendar.*;
import java.text.SimpleDateFormat;
void init (org.zkoss.calendar.Calendars calendar) {
calendar.setMold("month");
SimpleDateFormat sdf = new SimpleDateFormat("yyyy/MM/dd hh:mm:ss");
sdf.setTimeZone(calendar.getDefaultTimeZone());
SimpleCalendarEvent sce = new SimpleCalendarEvent();
SimpleCalendarModel cm = new SimpleCalendarModel();
try {
sce.setBeginDate(sdf.parse("2012/12/24 00:00:01"));
sce.setEndDate(sdf.parse("2012/12/30 00:00:01"));
sce.setHeaderColor("#0D7813");
sce.setContentColor("#4CB052");
sce.setContent("Xmas");
cm.add(sce);
sce = new SimpleCalendarEvent();
sce.setBeginDate(sdf.parse("2013/01/24 00:00:01"));
sce.setEndDate(sdf.parse("2013/01/30 00:00:01"));
sce.setHeaderColor("#0D7813");
sce.setContentColor("#4CB052");
sce.setContent("Whatever");
cm.add(sce);
} catch (Exception e) {
e.printStackTrace();
}
calendar.setModel(cm);
}
]]></zscript>
<calendars id="calendar" onCreate="init(self);" />
</zk>