Announcement

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

    Timeline cuts off the last day

    Hi there,

    working with the timeline it seems that the last day of the given interval is not included in the timeline anymore.
    Neither at the beginning nor by calling setTimelineRange.
    At the beginning I'm setting the whole January (1st January - 31st January), but the timeline cuts off the 31st January
    Click image for larger version

Name:	20160128-092016.png
Views:	42
Size:	5.4 KB
ID:	234489

    Same problem when I'm calling setTimeRange on the Timeline (here with the whole Febrauray 206 (1st February - 29th February)
    Click image for larger version

Name:	20160128-092303.png
Views:	30
Size:	4.8 KB
ID:	234490

    When setting the intervall, the last day should also be drawn in the Timeline. We don't know the specific version, when this bug appeared the first time, but in an "old" version this worked like expected (v10.0p_2015-05-11/Pro Deployment).
    It's reproducable in all browsers with the latest nightly SmartClient_v101p_2016-01-27_Pro.
    This does not only affect SC10.1 versions but also in our productive used version (v10.0p_2015-11-26/Pro Deployment)

    Code for reproduction:
    Code:
    isc.Button.create({
        "ID" : "a",
        "click" : function () {
            myTimeline.setTimelineRange(new Date(2016, 1, 1), new Date(2016, 1, 29));
            myTimeline.setData([]);
        },
        "title" : "Set February",
    });
    isc.Timeline.create({
        "ID" : "myTimeline",
        "width" : "100%",
        autoDraw : true,
        top : 50,
        "height" : "100%",
        "overflow" : "auto",
        "hideUsingDisplayNone" : false,
        "startDate" : new Date(2016, 0, 1),
        "endDate" : new Date(2016, 0, 31),
        "headerLevels" :
        [{
                "unit" : "week"
            }, {
                "unit" : "day",
                "titleFormatter" : function (headerLevel, startDate, endDate, defaultValue, viewer) {
                    return startDate.getDate()
                },
                "headerWidth" : 24
            }
        ],
        "canEditEvents" : false,
        "canCreateEvents" : false,
        "showControlsBar" : false,
        "firstDayOfWeek" : 1,
        "height" : 200,
        "weekPrefix" : "Week",
        "todayBackgroundColor" : "#999900",
        "showEventHeaders" : false,
        "showEventDescriptions" : false,
        "labelColumnWidth" : 200,
        "alternateLaneStyles" : true,
        "laneFields" :
        [{
                "name" : "title",
                "title" : "&nbsp",
                "type" : "text",
                "canEdit" : false
            }
        ],
        "lanes" :
        [{
                "hierarchyLevel" : 0,
                "height" : 30,
                "name" : "1",
                "title" : "ExampleLane"
            }
        ],
        "data" :
        []
    })
    Best Regards

    #2
    Timelines will forcibly adjust their start and end dates so they sit at a granularity boundary - for the end date, this is one millisecond before the start of the next unit - for days, the very end (23:59:59.999) of the passed date.

    In your case, your endDates are being created as midnight on the specified date - the timeline takes off a millisecond (23:59:59.999 on the previous day) and then rounds to the end of that same day (so, the same value).

    You can can fix your issues by just applying a time portion to your end dates - any will do, for example:

    Code:
    // 12 noon
    new Date(2016, 1, 1, 12)
    // or even just 1ms
    new Date(2016, 1, 1, 0, 0, 0, 1)
    or you could provide the dates as SmartClient logicalDates:

    Code:
    Date.createLogicalDate(2016, 1, 1)

    Comment


      #3
      Thanks, because the timeline does work with full days I'm working with
      Code:
      new Date(2016, 1, 1, 23, 59, 59)
      Thanks for the response
      Regards

      Comment

      Working...
      X