Announcement

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

    Timeline with hidden weekends showing events wrong

    SmartClient Version: v10.1p_2016-02-26/Pro Deployment (built 2016-02-26)

    Hi, I have a timeline with showWeekends:false and it is showing events that start on a Sunday as if they start on a Friday.
    Click image for larger version

Name:	TimelineWeekendError.png
Views:	41
Size:	12.0 KB
ID:	235793

    Code:
    public Timeline getTimeline()
        {
            final Timeline timeline = new Timeline();  
            timeline.setHeight100();
            timeline.setCanRemoveEvents(false);
            timeline.setCanEditLane(true);  
            timeline.setShowEventDescriptions(false); 
            timeline.setEventSnapGap(1440); // 60 * 24
            timeline.setShowIndicators(true);
            timeline.setUseEventCanvasRolloverControls(false); 
            timeline.setFirstDayOfWeek(0);
            timeline.setLaneEventPadding(2); // add a little space around events  
            timeline.setShowWeekends(false);
            HeaderLevel[] headerLevels = new HeaderLevel[]{  
                new HeaderLevel(TimeUnit.WEEK),
                new HeaderLevel(TimeUnit.DAY)
            };  
            timeline.setHeaderLevels(headerLevels);  
            timeline.setLaneFields(new ListGridField[]{ new ListGridField("title", "Developer", 120)});  
            timeline.setLanes(TimelineLaneData.getRecords());  
            timeline.setData(TimelineData.getRecords());
            
            Date startDate = new Date(116, 2, 7);
            // if you don't call this, you'll get defaultTimelineColumnSpan columns (20)
            timeline.setStartDate(startDate);
            Date endDate = new Date(116, 3, 7);
            timeline.setEndDate(endDate);
            
            return timeline;
        }
        
        public static class TimelineData {  
              
            private static CalendarEvent[] records;  
            private static Date today = new Date(116, 2, 14);
            private static int year = today.getYear();  
            private static int month = today.getMonth();  
            private static int start = today.getDate();  
            
            public TimelineData() {  
            }  
            public static CalendarEvent[] getRecords() {  
                if (records == null) {  
                    records = getNewRecords();  
                }  
                return records;  
            }  
          
            public static CalendarEvent[] getNewRecords() {  
                
                return new CalendarEvent[]{  
                        new CalendarEvent(1, "Test 1", "", new Date(year, month, start - 1,0,0,0), new Date(year, month, start + 11,    0,0,0), "charlesMadigen"),  
                        new CalendarEvent(2, "Test 2", "", new Date(year, month, start,        0,0,0), new Date(year, month, start + 11,    0,0,0), "charlesMadigen"),
                        new CalendarEvent(3, "Test 3", "", new Date(year, month, start,        0,0,0), new Date(year, month, start + 12,    0,0,0), "charlesMadigen"),  
                        new CalendarEvent(4, "Test 4", "", new Date(year, month, start + 11,0,0,0), new Date(year, month, start + 15,    0,0,0), "charlesMadigen"),  
                        new CalendarEvent(5, "Test 5", "", new Date(year, month, start + 11,0,0,0), new Date(year, month, start + 16,    0,0,0), "charlesMadigen"),  
                        new CalendarEvent(6, "Test 6", "", new Date(year, month, start + 11,0,0,0), new Date(year, month, start + 17,    0,0,0), "charlesMadigen")
                };
            }  
        }  
        
        public static class TimelineLaneData {  
              
            private static Lane[] records;  
          
            public static Lane[] getRecords() {  
                if (records == null) {  
                    records = getNewRecords();  
                }  
                return records;  
            }  
          
            public TimelineLaneData() {  
            }  
          
            public static Lane[] getNewRecords() {  
                Lane[] lanes = new Lane[]{  
                getLane("charlesMadigen", "Charles Madigen", "Managers"),  
                getLane("tamaraKane", "Tamara Kane", "Developers"),  
                getLane("darcyFeeney", "Darcy Feeney", "Managers"),  
                getLane("kaiKong", "Kai Kong", "Developers"),  
                getLane("shelleyFewel", "Shelley Fewel", "Managers"),  
                getLane("garretMonroe", "Garret Monroe", "Developers")  
                };  
                return lanes;  
            }  
          
            private static Lane getLane(String name, String title, String devGroup) {  
                Lane lane = new Lane(name, title);  
                lane.setAttribute("devGroup", devGroup);  
                return lane;  
            }  
        }
    And also just an unrelated question.
    I have an indicator in my timeline with canEdit:false, but the mouse still changes to a move cursor when I mouse over it. Is that intended behavior?
    Code:
    timeline.setIndicators(new CalendarEvent(1, "Today", "", new Date(), null, false));

    #2
    Hey, have you been able to recreate this?

    Comment


      #3
      Yes, we see the issue - apologies for the wait time in getting it fixed, we've been working hard toward the imminent 6.0 release.

      We'll get this one, and your other Timeline issue, fixed as soon as we can and update here when it's done.

      Comment


        #4
        This one's been fixed for tomorrow's builds - your other report about a bug in event-overlapping is still queued but won't be long.

        Comment


          #5
          After upgrading to 6.0 I can confirm that this issue is fixed.
          Thank you.

          Comment

          Working...
          X