Proper way of rendering whole day tasks in Gantt chart.

Hello again,

I want to be able to render tasks that span a whole day as a whole block that covers whole day. To illustrate a whole day task in the context of our requirements, it is either this:



(Start date and end date covers one whole day April 12, 12:00 AM to April 13, 12:00 AM); or this:



(Some systems constitute this as a whole day, April 14, 12:00 AM to April 14, 11:59 PM)

When you render both of this events in the Gantt chart, I got varying results. (Please see the highlighted items as these represent the data blocks that I have mentioned above.





As you can probably see they are quite inconsistent. The 12:00 AM to 12:00 AM the next day example produced a shorter task block display compared to the 12:00 AM to 11:59 PM example. Also the second example exceeded the day block and went to the next day. Why is that? I have tried various combination of settings to satisfy our requirements which is to display whole day tasks or events in both date and time configurations as a whole day block (covers the whole day block for both April 12 and 14), but none have worked.

Can you provide the correct settings that I need to use. I will be providing the page file that I am using in order for you to check the current settings configuration that I am using on my project, with the additional settings that I have added to resolve this issue removed.

Thanks and looking forward to your response.

Best regards,

Attachment: Sample_4f8474fe.zip

1 Reply 1 reply marked as answer

MS Monisha Sivanthilingam Syncfusion Team June 4, 2021 10:07 AM UTC

Hi Denzel, 
 
Greetings from Syncfusion support. 
 
You can render tasks as a block that covers the whole day if you enter the task data as follows: 
 
 
new TaskData() { 
                TaskId = 1, 
                TaskName = "Task 1", 
                StartDate = new DateTime(2021, 04, 12,00, 00, 00), 
                EndDate = new DateTime(2021, 04, 12, 23, 59, 00), 
                Progress = 0, 
                DurationUnit ="day", 
                Description = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed turpis lorem, semper eu interdum a, viverra et magna." 
            }, 
 
 
The duration of the task when its dates are given as such would be calculated as one day and would render as such. However, currently we are facing some issue with rendering the tasks when the DayWorkingTime property is set to 24 hours. Which is why you were facing the issue you mentioned. We will validate that issue further and provide you with further details within two business days(June 8, 2021). In the meantime you could stop using the DayWorkingTime property to avoid this issue. 
 
We have modified your sample to include the changes we mentioned above. 
 
Please contact us if you have any concerns on this. 
 
Regards, 
Monisha. 


Marked as answer
Loader.
Up arrow icon