Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Calendar possible bug

    Hello,

    I'm using SmartGWT 4.1
    I've found a problem with operating events on a calendar with polish locale.
    1. Events cannot be added by dragging threw hours - after setting a title event does not show up on calendar.
    2. After moving event always jumps to 01:00am
    3. Resizing not working or jumps to 01:00am depends on setting hour.

    Simple test case from showcase:
    Code:
    public void testCalendar() {
    	DataSource eventDS = new DataSource();
            DataSourceSequenceField eventIdField = new DataSourceSequenceField("eventId");
            eventIdField.setPrimaryKey(true);
    
            DataSourceTextField nameField = new DataSourceTextField("name");
            DataSourceTextField descField = new DataSourceTextField("description");
            DataSourceDateTimeField startDateField = new DataSourceDateTimeField("startDate");
            DataSourceDateTimeField endDateField = new DataSourceDateTimeField("endDate");
    
            eventDS.setFields(eventIdField, nameField, descField, startDateField, endDateField);
            eventDS.setClientOnly(true);
            eventDS.setTestData(getCalendarRecords());
            
    	Calendar calendar = new Calendar();
    	calendar.setWidth100();
    	calendar.setHeight100();
    	calendar.setDataSource(eventDS);
    	calendar.setAutoFetchData(true);
    	this.addChild(calendar);
    }
    	
        private static CalendarEvent[] records;
        private static Date today = new Date();
        private static int year = today.getYear();
        private static int month = today.getMonth();
        private static int start = today.getDate() - today.getDay();
    
        public static CalendarEvent[] getCalendarRecords() {
            return new CalendarEvent[]{
                    new CalendarEvent(1, "Meeting", "Shareholders meeting: monthly forecast report", new Date(year, month, start + 2, 9, 0, 0), new Date(year, month, start + 2, 14, 0, 0)),
                    new CalendarEvent(2, "Realtor", "Breakfast with realtor to discuss moving plans", new Date(year, month, start + 3, 8, 0, 0), new Date(year, month, start + 3, 10, 0, 0)),
                    new CalendarEvent(3, "Soccer", "Little league soccer finals", new Date(year, month, start + 4, 13, 0, 0), new Date(year, month, start + 4, 16, 0, 0)),
                    new CalendarEvent(4, "Sleep", "Catch up on sleep", new Date(year, month, start + 4, 5, 0, 0), new Date(year, month, start + 4, 9, 0, 0)),
                    new CalendarEvent(5, "Inspection", "Home inspector coming", new Date(year, month, start + 4, 10, 0, 0), new Date(year, month, start + 4, 12, 0, 0), false, "testStyle"),
                    new CalendarEvent(6, "Airport run", "Pick James up from the airport", new Date(year, month, start + 4, 1, 0, 0), new Date(year, month, start + 4, 3, 0, 0)),
                    new CalendarEvent(7, "Dinner Party", "Prepare elaborate meal for friends", new Date(year, month, start + 4, 17, 0, 0), new Date(year, month, start + 4, 20, 0, 0)),
                    new CalendarEvent(8, "Poker", "Poker at Steve's house", new Date(year, month, start + 4, 21, 0, 0), new Date(year, month, start + 4, 23, 0, 0)),
                    new CalendarEvent(9, "Meeting", "Board of directors meeting: discussion of next months strategy", new Date(year, month, start + 5, 11, 0, 0), new Date(year, month, start + 5, 15, 0, 0))
            };
        }
    Compile with and without:
    Code:
    <extend-property name="locale" values="pl" />
    By the way why there isn't a simple way (or I could not find it) to intercept creation of events on day/week view like you can o month view?

    I've used a horrible workaround sometime ago, but after upgrading to SmartGWT 4.1 it stopped working and need to find other way.

    Best regards
    Mariusz Goch

    [Update] Bug still exists in nightly SmartGWT 4.1p 2013-03-25
    Last edited by pH4Lk0n; 25 Mar 2014, 10:25.

    #2
    Originally posted by pH4Lk0n View Post
    Hello,

    I'm using SmartGWT 4.1
    I've found a problem with operating events on a calendar with polish locale.
    1. Events cannot be added by dragging threw hours - after setting a title event does not show up on calendar.
    2. After moving event always jumps to 01:00am
    3. Resizing not working or jumps to 01:00am depends on setting hour.

    Simple test case from showcase:
    Code:
    public void testCalendar() {
    	DataSource eventDS = new DataSource();
            DataSourceSequenceField eventIdField = new DataSourceSequenceField("eventId");
            eventIdField.setPrimaryKey(true);
    
            DataSourceTextField nameField = new DataSourceTextField("name");
            DataSourceTextField descField = new DataSourceTextField("description");
            DataSourceDateTimeField startDateField = new DataSourceDateTimeField("startDate");
            DataSourceDateTimeField endDateField = new DataSourceDateTimeField("endDate");
    
            eventDS.setFields(eventIdField, nameField, descField, startDateField, endDateField);
            eventDS.setClientOnly(true);
            eventDS.setTestData(getCalendarRecords());
            
    	Calendar calendar = new Calendar();
    	calendar.setWidth100();
    	calendar.setHeight100();
    	calendar.setDataSource(eventDS);
    	calendar.setAutoFetchData(true);
    	this.addChild(calendar);
    }
    	
        private static CalendarEvent[] records;
        private static Date today = new Date();
        private static int year = today.getYear();
        private static int month = today.getMonth();
        private static int start = today.getDate() - today.getDay();
    
        public static CalendarEvent[] getCalendarRecords() {
            return new CalendarEvent[]{
                    new CalendarEvent(1, "Meeting", "Shareholders meeting: monthly forecast report", new Date(year, month, start + 2, 9, 0, 0), new Date(year, month, start + 2, 14, 0, 0)),
                    new CalendarEvent(2, "Realtor", "Breakfast with realtor to discuss moving plans", new Date(year, month, start + 3, 8, 0, 0), new Date(year, month, start + 3, 10, 0, 0)),
                    new CalendarEvent(3, "Soccer", "Little league soccer finals", new Date(year, month, start + 4, 13, 0, 0), new Date(year, month, start + 4, 16, 0, 0)),
                    new CalendarEvent(4, "Sleep", "Catch up on sleep", new Date(year, month, start + 4, 5, 0, 0), new Date(year, month, start + 4, 9, 0, 0)),
                    new CalendarEvent(5, "Inspection", "Home inspector coming", new Date(year, month, start + 4, 10, 0, 0), new Date(year, month, start + 4, 12, 0, 0), false, "testStyle"),
                    new CalendarEvent(6, "Airport run", "Pick James up from the airport", new Date(year, month, start + 4, 1, 0, 0), new Date(year, month, start + 4, 3, 0, 0)),
                    new CalendarEvent(7, "Dinner Party", "Prepare elaborate meal for friends", new Date(year, month, start + 4, 17, 0, 0), new Date(year, month, start + 4, 20, 0, 0)),
                    new CalendarEvent(8, "Poker", "Poker at Steve's house", new Date(year, month, start + 4, 21, 0, 0), new Date(year, month, start + 4, 23, 0, 0)),
                    new CalendarEvent(9, "Meeting", "Board of directors meeting: discussion of next months strategy", new Date(year, month, start + 5, 11, 0, 0), new Date(year, month, start + 5, 15, 0, 0))
            };
        }
    Compile with and without:
    Code:
    <extend-property name="locale" values="pl" />
    By the way why there isn't a simple way (or I could not find it) to intercept creation of events on day/week view like you can o month view?

    I've used a horrible workaround sometime ago, but after upgrading to SmartGWT 4.1 it stopped working and need to find other way.

    Best regards
    Mariusz Goch

    [Update] Bug still exists in nightly SmartGWT 4.1p 2013-03-25
    Check out this thread: http://forums.smartclient.com/showthread.php?t=29826

    I have the similar issue.

    Comment


      #3
      Originally posted by lado View Post
      Check out this thread: http://forums.smartclient.com/showthread.php?t=29826

      I have the similar issue.
      Yes same problem. :(
      Unfortunately no the only one.
      There is another bug in calendar.

      If you drag an event to midnight huge gap beyond grid appears.
      It is also visible in showcase.

      Checkout attached screenshot from showcase.

      Best regards
      Mariusz Goch
      Attached Files

      Comment


        #4
        We're taking a look

        Comment


          #5
          We've made a change that should address all of these issues - please retest with a build dated March 27 or later

          Comment


            #6
            Hello,

            I've just checked latest SmartGWT nightly (4.1p 2014-03-27).
            Problems with jumping events after drag on polish locale were solved.

            Unfortunately bug on drag to midnight still exists.
            While draging event to midnight huge space appears below grid like on screenshot.

            Best regards

            Comment


              #7
              This is fixed for tomorrow's build

              Comment


                #8
                Hello,

                Problem still exists in SmartGWT nightly 4.1p 2014-03-29.
                It occurs in my test case and in attached to zip showcase.

                Best regards
                Mariusz Goch

                Comment


                  #9
                  We've fixed a couple of bugs in this area today - when you say "while draging event to midnight", do you mean drag MOVE or drag RESIZE? And do you mean Midnight at the top or the bottom of the view?

                  Comment


                    #10
                    Originally posted by Isomorphic View Post
                    We've fixed a couple of bugs in this area today - when you say "while draging event to midnight", do you mean drag MOVE or drag RESIZE? And do you mean Midnight at the top or the bottom of the view?
                    Initially I meant resize but now both (I've checked the other scenario). And also problem is with midnight before and after.

                    Checked version 4.1p build 31 Mar.

                    1. [New problem] Moving events is shifted for an hour.
                    Trying moving any event anywere. It ends up hour before.
                    Resize also has this problem.

                    2. Resize an event to midnight (after event).
                    You can now scroll under the grid and empty space appears like on screenshot send before.

                    Best regards
                    Mariusz Goch

                    Comment


                      #11
                      Your new point 1) was already fixed today, along with a couple of other small bugs - the other issues should be fixed today - we'll update when they are.

                      Comment


                        #12
                        This has been fixed for builds dated April 2 and later.

                        Comment


                          #13
                          Yes. It was fixed in nightly 2014-04-02.
                          Best regards
                          Mariusz Goch

                          Comment

                          Working...
                          X