Open Moult opened 3 years ago
Thanks for that!
Because a group task could have start and end date, that basically take the min date and max date from the children tasks.
So the getMinDate method, returns the current date just if you dont have tasks. When you have tasks it will start to find the min with minDate or the first task list. https://github.com/jsGanttImproved/jsgantt-improved/blob/7d696916467dee891f2f33640fbcc7612f89a984/src/utils/date_utils.ts#L9
Seems to be correct, no?
In this line of code, vDate defaults to the current date: https://github.com/jsGanttImproved/jsgantt-improved/blob/7d696916467dee891f2f33640fbcc7612f89a984/src/utils/date_utils.ts#L6
Also problematically, in this line of code, functions like getStart default to the current date if no date is found (such as when the task is a group and has no start/end): https://github.com/jsGanttImproved/jsgantt-improved/blob/7d696916467dee891f2f33640fbcc7612f89a984/src/utils/date_utils.ts#L13-L14
When these two behaviours are combined it means that when your first grouped task has a min date of sometime in the future, the gantt chat always begins at today, even if vMinDate is specified.
This can be very troublesome when doing projects where the project begins a few years in the future, as you will have many years of nothing happening.
Sample code: