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

CalendarEvent can accept that beingDate and endDate are the same time

XMLWordPrintable

    • Icon: New Feature New Feature
    • Resolution: Fixed
    • Icon: Later Later
    • 3.0.0
    • 2.1.5
    • Security Level: Jimmy
    • None

      use case

      Users use this zero duration meeting request as a reminder. Outlook/Office365 allows it.

      steps to reproduce

      1. load the attached zul

      actual result

      an error modal window which contains "Illegal date: from Mon Sep 12 18:19:48 CST 2016 to Mon Sep 12 18:19:48 CST 2016" appears.

      expected result

      users can set the same time both on the begin date and end date.

      extra info

      • we can still add such 0-time event with the code below
        	SimpleCalendarEvent sce = new SimpleCalendarEvent();
        	java.util.Calendar calendar = java.util.Calendar.getInstance();
        	Date today = calendar.getTime();
        	sce.setBeginDate(today);
        	sce.setEndDate(today);
        	sce.setContent("This is the content of the event");
        	sce.setTitle("This is the title of the event");
        	cal.addDayEvent(sce);
        

        But Calender displays it as a very small box with 4px height. It's hard to operate it.

      • when rendering such 0-time event, Calendar should still render it with a minimal height.

      workaround

      • create a custom class, e.g. SameTimeCalendarEvent which extends SimpleCalendarEvent and accepts same time for both beginning and end date but internally turns the end date into half hour later than begin date. So that ZK calendar will show the event in a larger box. When call SameTimeCalendarEvent.getEndDate(), it still returns the same date time as the being date.

            Leon03 Leon03
            hawk hawk
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: