Our state of the art Gantt chart


Post by Gioacchino Gaudioso »

The duration get calculated between start date and end date is seems always 1 day less,
for example if I set start date of activity 1st April 2021 and end date 30th April 2021, then the duration for working days should be 22 days not 21 days.

Please refer the attached screenshot, Please suggest how I can overcome this issue.

Please see the selected task
Please see the selected task
Capture.PNG (59.31 KiB) Viewed 421 times

Post by saki »

It is from midnight April 1st to midnight April 30th (not including), therefore 21 days. 29 - 8(weekends) = 21.


Post by Gioacchino Gaudioso »

Hi Saki,
Thanks for your response, but logically this is not correct, the end date should include the complete date.

Although, Is there any possibility to handle this , I mean I need to keep the end date as 30th April but the duration should be 22 day , Including the 30th April.

Thank you


Post by arcady »

Hello,

If you enable format including time info it will get cleaner to you.

I see that you are checking the advanced demo. Just change start/end column definitions there like this:

    columns                 : [
        ...
        { type : 'startdate', format : 'Y-MM-DD HH:mm:SS' },
        { type : 'enddate', format : 'Y-MM-DD HH:mm:SS' },

Then make a new 1 day task by clicking + CREATE button.

1.png
1.png (6.04 KiB) Viewed 408 times

As you can see start and end dates are 2019-01-14 00:00:00 and 2019-01-15 00:00:00 respectively. Since 1 day means 24 hours in that demo (units are configurable).

If you change the task duration:
to 1h its end date will be 2019-01-14 01:00:00,
to 2h its end date will be 2019-01-14 02:00:00,
...
to 23h its end date will be 2019-01-14 23:00:00,
to 24h (aka 1 day) its end date will be 2019-01-15 00:00:00
We don't do any dates adjustment actually ..this is just how they work.

MS Project deals w/ dates the same way the Gantt does. MS Project just uses 8 hrs/day project calendar by default. So 1 day duration means 8 hrs and such task starts for example 2020-05-26 08:00 and finishes 2020-05-26 17:00. By default MS Project doesn't show time part of dates so it's shown as 2020-05-26 - 2020-05-26.

Try using 8hrs a day calendar to see the dates you expect. You can try that on the advanced demo (even online the demo). Just execute this code in your browser console:

gantt.project.hoursPerDay = 8
gantt.project.calendar = 'business'

Post Reply