Uploaded image for project: 'ZK Calendar'
  1. ZK Calendar
  2. ZKCAL-32

Event length not correct in next month

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • 2.1.3
    • 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>
      

            vincentjian vincentjian
            benbai benbai
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: