Error if start date for all task is null

If start date for all task is null it shows error " Invalid day index".
How to handle this so that it should not show error massage to user?

Hello,
Tasks should have start_date and duration/end_date parameters. If you want to have tasks without those parameters, they should have “unscheduled” parameter. In that case those tasks won’t be displayed in the timeline, but you will see them in the grid:
https://docs.dhtmlx.com/gantt/desktop__unscheduled_tasks.html
In the following snippet if tasks don’t have start_date, they become unscheduled:
https://snippet.dhtmlx.com/1c6v3kg9
You need to update tasks before parsing the data or you’ll get the error message.