I need to Calculate End Date Day and also display in chart. For Example :
Start Date : 01/12/2014
End Date : 15/12/2014
Exclude : saturday and sunday.
So it will display 10 days. (Exclude last day 15/12/2014).
I need to include last day 15/12/2014 in calculation.
Hello,
Currently there is no option for such mode. The dates are interpreted not inclusively, e.g. 20-05-2014 is interpreted as 00:00:00 20 May 2014 - which means task ends by 20 May, not including the day.
Hello,
I know the topic is a few years old, but I have the same problem, i need to include end date in calculation and display in chart.
I tried to use the example, but i couldn’t do it.
I have to show correct end_date on the gantt. In the lightbox i have a time field with start and end, and i need to show correctly. I have a resources gantt with hours. And i need to save the end_date on the db. how do i do it?
Thank you.
Hello,
There is no built-in way to change how Gantt works.
There are various workarounds that you can use, but the easiest way would be to subtract 1 minute from the end_date of the task before updating it.
Here is the snippet that demonstrates how it works: http://snippet.dhtmlx.com/5/6c6103859
Hi. Thank you.
I did it, but I have a problem. When i link 2 tasks, the 2nd task get bug. When i refresh the page, everything is ok.
I have the same problem when i move a task
Example:
(Before i link tasks)
(After i link tasks)
(After i refresh the page)
I try to use this code:
gantt.attachEvent("onAfterTaskUpdate", function (id, task) {
gantt.refreshTask(id);
gantt.render();
}
Please, reproduce the issue in the snippet, then click on the “Share” button and send me the link.
Or send me an HTML file with all the necessary Javascript and CSS files.
I know the topic is a few years old, but I have the same problem. I used a solution by ramil and it works great except for milestones.
I have the following examples, where you can see that now the end_date is before start_date, which is not ok:
Unfortunately your solution does not solve my problem completely. If I put milestone at the end, than parent task end date should be equal to milestone start date (but in gantt there comes to one day lack). I prepared an image comparing Project and DHTMLX and I wonder if there is there a chance to match those gantt grids to look same?
Hello Marko,
Thank you for the clarification.
It works that way because the milestone actually starts 04 April, but its duration is 0.
It seems that there is no easy solution for that.
I would suggest adding a custom task type that will look like a milestone, but it can behave like a regular task with any duration.
Here is an example: http://snippet.dhtmlx.com/5/b5c6ae5f3
Get a guaranteed answer from DHTMLX technical support team
under the most suitable support plan