Issue with rendering order of events in timeline

Hi,

I am using dhtmlx scheduler library in javascript.

dhtmlxScheduler v.4.4.9 Professional
dhtmlxScheduler v.4.4.9 Professional

When the following set of sequence is used to create the timeline, I expected Event 5 to be displayed above Event 6.

[
  {
    "start_date": "2018-09-01",
    "end_date": "2018-09-02",
    "section_id": "1",
    "text": "Event 1"
  },
  {
    "start_date": "2018-09-01",
    "end_date": "2018-09-03",
    "section_id": "1",
    "text": "Event 2"
  },
  {
    "start_date": "2018-09-02",
    "end_date": "2018-09-03",
    "section_id": "1",
    "text": "Event 3"
  },
  {
    "start_date": "2018-09-02",
    "end_date": "2018-09-04",
    "section_id": "1",
    "text": "Event 4"
  },
  {
    "start_date": "2018-09-03",
    "end_date": "2018-09-12",
    "section_id": "1",
    "text": "Event 5"
  },
  {
    "start_date": "2018-09-03",
    "end_date": "2018-09-05",
    "section_id": "1",
    "text": "Event 6"
  }
]

Demo Link: http://docs.dhtmlx.com/scheduler/snippet/73d99a5d

I traced the code in dhtmlxscheduler_timeline.js. In function scheduler._timeline_get_events_html after code

						var _max_sorder = stack[0]._sorder;
						for (var w = 1; w < stack.length; w++)
							if (stack[w]._sorder > _max_sorder)
								_max_sorder = stack[w]._sorder;
						ev._sorder = _max_sorder + 1;
						ev._inner = false;

If I remove 0 the element stack.splice(0,1);, the problem is fixed.

The idea behind this fix is essentially when the first element in the stack is used to determine the sorder of the element, it should not be considered to determine sorder for next event.

Is this the right fix? Any help in this regard would be greatly appreciated.

You may try to change the order of the events using your own custom sorting function.
Here you can find an example:
https://docs.dhtmlx.com/scheduler/samples/06_timeline/10_order_and_rounding.html