End date point precision issue

For example,I set end_date is 2022-11-24 23:59:59,but the end point looks like 2022-11-24 00:00:00,search the doc,i don’t find any way to fix it.So, how can I set the config?THX.

If you load a task with the specified start_date and end_date parameters, it should have these dates:

The minimal scale and duration_unit in DHTMLX Gantt is minute:

So, if you drag a task, its dates will be rounded.

You will need to implement a custom scale and duration_unit if you want to have the second scale:

If you don’t want to round the dates with the custom second unit, you need to store the task dates in a variable, then restore them in the onAfterTaskDrag event handler:

Also, you need to know that Gantt uses non-inclusive end_date/duration. There is no way to change how Gantt works, but you can change what is displayed to the users by using the templates:

Here is an example of how it works:

Also, you can set the duration_unit to ‘hour’ and enable the work_time parameter:

Gantt will show the same dates in the grid because the hours will be different.
To show the duration in days and even in fractional values, you can use the formatters:

Here is an example with the date input type in the inline editors:

Here we need to modify the dates because the input element with the date type doesn’t have the hour values.

Here is another example with the datetime-local input type in the inline editors:

The input element may take more space, but it will store the dates more accurately.

Hello ramil, with the help of this topic, I have a question to ask, that is, in the task data transmitted from my backend to the frontend, the start time and end time have been given and the duration has been given, but when rendering in gantt, the duration will be inexplicable one day less
As shown in the figure, my start time is 11/01/8:00 and my end time is 11/30/16:00. My calendar is set for 8:00~16:00 from Monday to Sunday,According to the calendar, my deadline should be 30 days, but it turned out to be one day short.
Looking forward to your reply, thank you

I suppose you use the “day” duration_unit. In this case, the duration is calculated in days, and Gantt will round the duration to the days if the hours are specified.
I added a simple dataset into the following snippet:

You can use the “hour” duration_unit with the formatter extension:
This will allow you to store the duration in hours but show it in days in Gantt.
Here is an example:

If you specify the start_date and end_date parameters, the duration parameter is ignored and calculated depending on the date parameters:

So if you save the dates in the inclusive format on the server, and use the “day” duration_unit, you need to convert the dates to the non-inclusive format before loading them into Gantt. Then you need to convert them back when saving the changes on the server.

But as you can see, with the “hour” duration_unit it is working better.