Announcement

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

    timeline's event size are not set correctly

    I'm facing this bug changing version of SC, from v110p_2016-10-01 to v110p_2016-11-24.

    In the older version, if a datediff of an event it was smaller than 24h, also the size of the event it was smaller of the cell.

    Now, in the newest version, it doesn't.

    so, if you try the code below in the v110p_2016-10-01 , the size of the event is as large as half of the cell (accordly with the event time span). instead in the v110p_2016-11-24 the size of the event is alway as large as the cell


    code to reproduce here #timelineResolution:

    timelineResolution.js:

    Code:
    var developers = [
        { name: "charlesMadigen", title: "Charles Madigen", height: 80 },
        { name: "tamaraKane", title: "Tamara Kane", height: 80 },
        { name: "kaiKong", title: "Kai Kong", height: 100 },
        { name: "shellyFewel", title: "Shelly Fewel", height: 80 }
    ];
    
    var _calStart = isc.DateUtil.getStartOf(new Date(2012, 6, 5), "W");
    var _calEnd = _calStart.duplicate();
    _calEnd.setDate(_calEnd.getDate() + 7);
    
    isc.Timeline.create({
        ID: "timeline", 
        top: 40,
        height: 451,
        startDate: _calStart, 
        endDate: _calEnd,
        data: events,
        lanes: developers,
        headerLevels: [
                            {
                                unit: "month",
                                titleFormatter: function (headerLevel, startDate, endDate, defaultValue, viewer) {
                                    return DateUtil.format(startDate, "MMMM") + " " + startDate.getFullYear();
                                }
                            },
                            {
                                unit: "day", headerWidth: 150,
                                titleFormatter: function (headerLevel, startDate, endDate, defaultValue, viewer) {
                                    var dayNum= startDate.getDate();
                                    return DateUtil.format(startDate, "dddd") + " " + dayNum;
                                }
                            }
                        ],
        laneFields: [ { name: "title", title: "Developer", minWidth: 120, autoFitWidth: true } ],
        canEditLane: true,
        showEventDescriptions: true,
        laneEventPadding: 2,
        disableWeekends: false,
        showCellHovers: true
    });

    taskData:

    Code:
    var _today = isc.DateUtil.getStartOf(new Date(2012, 6, 5), "W");
    
    var _start = _today.getDate() - _today.getDay();
    var _month = _today.getMonth();
    var _year = _today.getFullYear();
    
    var events = [
    
    {
        eventId: 1, 
        name: "Add new Timeline view",
        description: "Add a new calendar Timeline component",
        startDate: new Date(_year, _month, _start, 0, 0, 0),
        endDate: new Date(_year, _month, _start, 12, 0, 0),
        lane: 'charlesMadigen'
    }
    ];

    #2
    See the doc for Calendar.eventSnapGap in the new build you're using:

    1) if it's unset, default behavior is to snap only to cell boundaries - 1 day in your case - the event is still 12 hours long (see it's hover) but it is being rendered to snapGaps that occur every 1 day

    2) eventSnapGap:0 is a special value that uses a special default for each unit type (hour, day, week, etc) - in your case, it would snap every 1 hour.

    3) eventSnapGap:1 will use the minimum minutes per snapGap that can be represented in the current view - in you case, with "day" columns, it would be every 30 minutes with the default column-width of 60px.

    4 )if you want, for example, 12-hour snaps, just set eventSnapGap to the minute quantity - say, 12*60

    Comment


      #3
      I missed the changelog note, thanks for the explanation.

      Now it works perfectly.

      Comment

      Working...
      X