DHTMLX - Scheduler .NET - How to adjust position of TimeLine Cell Follow By Hour

As you can see the image below,
What I wanna archive is the position of TimeLine Cell That should be correct Follow by Hour

For example:

  • FromDate: 2019-12-05 10:00
  • ToDate: 2019-12-06 14:00
    ==> It should be displayed like expected state.

I really appreciate your help.

Hi @Phong_Nguyen,

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.

Hi, @Phong_Nguyen

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):

RoundPosition = true:
https://files.dhtmlx.com/30d/078384e57e5106f0f05305e6df4bc738/TimelineView-RoundPosition=true.zip

RoundPosition = true:
https://files.dhtmlx.com/30d/2bbe989574fdac99f0bc59001d21f1fd/TimelineView-RoundPosition=false.zip

Thank you for your response.
I’ll try it as soon as possible. And get back to you soon. @Aliaksandr @Polina