The event length is calculated automatically based on the event’s dates in the Timeline view.
I tried to reproduce the issue in the snippet http://snippet.dhtmlx.com/710995c16 and dates displayed properly (as “expected state” on your screenshot).
Can you update the code to get the “current state” from your screenshot? That will help me to investigate your issue.
This can be caused by round_position (JS) or RoundPosition (C#) property of the timeline view.
If you set the “round position” property to “true”, events are expected to snap to the timeline grid, as in your “CURRENT STATE”, otherwise, they will be positioned according to their actual durations.
Can you please check your code to see if you have .RoundPosition = true assignment somewhere.
If you find it - does anything changes if you comment out that line?
var timeline = new TimelineView("timeline", "section_id");
timeline.RoundPosition = true;
Here are the complete samples (you’ll need to restore NuGet packages before running the app):