Hello,
It happens because Gantt uses non-inclusive duration. If you open the lightbox, you will see that Task #1 ends on 18 October. By default, tasks start at 00:00. So, to be more precise the task starts 2018-10-15 00:00 and ends 2018-10-18 00:00:
There are many ways to work around that behavior, but the easiest way is to subtract 1 minute from the end date before updating the task. Here is an example of how it might be implemented: http://snippet.dhtmlx.com/a73af08c3
Get a guaranteed answer from DHTMLX technical support team
under the most suitable support plan