Gantt Task Last Segment's EndDate is not correct

Hi,

I have Gantt task with the StartDate & EndDate property set from it's segments, see the following code below:


                    var segments = (await repository.GetWorkingCalendarsAsync(plant.PlantCode)).Select((e, sidx) =>

                    {

                        return new ProductionOrderGanttSegmentModel

                        {

                            SegmentId = segmentId++,

                            TaskId = taskId,

                            PlantId = plant.PlantCode,

                            SegmentStartDate = e.Date,

                            SegmentDuration = e.Hours!.ToString(),

                            SegmentEndDate = e.Date.AddHours(e.Hours.Value),

                        };

                    }).ToList();


                    gantt.Add(new ProductionOrderGanttModel

                    {

                        TaskId = taskId,

                        Plant = plant,

                        TimeSegments = segments,

                        StartDate = segments.OrderBy(e => e.SegmentStartDate)?.First().SegmentStartDate,

                        EndDate = segments.OrderByDescending(e => e.SegmentEndDate)?.First().SegmentEndDate,

                    });


Move to the Page.razor, when I set

<SfGantt Data source="@gantt">

The task's timeline EndDate is correct --> 1/2/2025 04:00 PM


but if the last segment's EndDate become incorrect if I apply the segment into SfGantt like the following code below:

<SfGantt Data source="@gantt">

    <GanttSegmentFields DataSource="@segments">

<SfGantt>


Problem details:

  • EndDate in the column is correct --> 1/2/2025
  • Task's timeline ended at 1/23/2025 instead of 1/2/2025
  • Last segment Duration is 360​, the correct value is 16 (hour) and the EndDate is 1/23/2025 instead of 1/2/2025


What is the causes of the issue? How to solve this?

Thank you for anyone who helped.

Image_1965_1732026568925


8 Replies

AG Ajithkumar Gopalakrishnan Syncfusion Team November 20, 2024 11:09 AM UTC

Hi Muhammad,

Greetings from Syncfusion Support,


Before proceeding, we kindly request you to share more information to help us identify the cause of the issue. We request you to share more information to achieve your requirement. Kindly share the details below.

  • The full code snippet of the Gantt chart with package and theme version details.
  • A video demo to replicate the issue, including replication steps.
  • Specific information about one of the task segments, as the shared task start and end dates are insufficient. The segment collection details were not included and are unclear in the provided image. Share the complete details of one task, including its dataSource and segment collection, for validation.
  • Replicate the problem using our sample, share those details.


Sample link: https://www.syncfusion.com/downloads/support/directtrac/general/ze/FetchData-1761225562.zip

Once we receive this information, we will be better equipped to identify the root cause of the issue and provide you with the necessary assistance.

Regards,
Ajithkumar G



MU muhirwanto.dev November 20, 2024 11:39 AM UTC

Hi Ajithkumar,
Thank you for your response.

Here I attach the complete codes related to the Gantt Chart (not complete codes of whole project). The zip file containing:

#DataSource from Enumerable values
Complete codes/Gantt_DataSource.csv
Complete codes/GanttSegments_DataSource.csv

#Razor component for the UI
Complete codes/ Index.razor

#Back code
Complete codes/ProductionOrderViewModel.cs
Complete codes/
ProductionOrderGanttModel.cs
Complete codes/ProductionOrderGanttSegmentModel.cs

#Screen recording
The issue is triggered directly after page loading (no additional steps)

#Package version
Syncfusion.Blazor 27.2.2
Syncfusion.Blazor.Themes 27.2.2

I attaches the zip files containing the mentioned data above, let me know if you still need something else.

Regards,
Irwan


Attachment: SyncfusionGanttSegmentsIssue_f497e9b6.zip


MU muhirwanto.dev replied to Muhammad Irwanto November 20, 2024 11:46 AM UTC

Here is the steps to reproduce the issue:

  • Load the page
  • Wait until Gantt timeline is loaded
  • Click first or task or any
  • Click 'Edit' button
  • Once the dialog showed, click 'Segments' and scroll to the bottom
  • Notice that the last segment Duration is 360, and the EndDate is 01/23/2025
  • Check the DataSource in Complete codes/Gantt_DataSource.csv and Complete codes/GanttSegments_DataSource.csv
  • Notice there's no segment with Duration is 360 in the DataSource


AG Ajithkumar Gopalakrishnan Syncfusion Team November 25, 2024 01:52 PM UTC

Hi Muhammad,

We have ensured that the shared Excel file, based on the first record and segment, renders the same data on our end, and the issue has not been replicated. Therefore, we need to check the overall dataSource in the Gantt chart. We need to convert the CSV file to a dataSource, then validate it. We will ensure everything is in order and share the details on Nov 27, 2024.

Regards,
Ajithkumar G



VS Vignesh Sivalingam Syncfusion Team November 27, 2024 12:47 PM UTC

Hi Muhammad,


We have identified the reported behavior as an issue on our end and have logged it as “Issue with incorrect segment duration and end date in Gantt Dialog” We sincerely appreciate your effort in reporting this issue and helping us enhance our product.

At Syncfusion, we are committed to addressing all validated defects, subject to technical feasibility and our product development lifecycle. We aim to include the fix for this issue in the upcoming Volume 4 main release scheduled for mid-December 2024.
You can track the progress of the resolution by visiting the feedback link provided below:

Disclaimer: Inclusion of this fix in the patch release is subject to various factors, including QA checks and work reprioritization.
Thank you for your patience and understanding. Please let us know if you have any additional questions or concerns.


Regards,

Vignesh Sivalingam



AG Ajithkumar Gopalakrishnan Syncfusion Team December 14, 2024 05:44 AM UTC

Hi Muhammad,

We are glad to announce that our Essential Studio® 2024 Volume 4 Main Release v28.1.33 is rolled out and is available for download under the following link.


https://www.syncfusion.com/forums/195512/essential-studio-2024-volume-4-main-release-v28-1-33-is-available-for-download  

The fix for the issue “Issue with incorrect segment duration and end date in grid end” has been rolled out in our Volume 4 Main Release v28.1.33. So upgrade to our latest version to resolve the problem.

Sample link and dataSource as attached zip file.

Root cause: The task end date update is not handled after calculating the segment using the UpdateSegmentCollection() method.

Release notes: https://blazor.syncfusion.com/documentation/release-notes/28.1.33?type=all#gantt-chart

We thank you for your support and appreciate your patience in waiting for this release. Please get in touch with us if you would require any further assistance.


Regards,
Ajithkumar G


Attachment: Counter_7fa29465.zip


MU muhirwanto.dev December 14, 2024 05:50 AM UTC

Hello Team,

Thank you for your help, I'm very appreciates that. I will check the new release.


Best Regards,

Muhammad



KG Kalpana Ganesan Syncfusion Team December 17, 2024 05:25 AM UTC

Hi Dev,


You’re welcome! I’m glad it helped. If you need any more assistance, feel free to ask.



Regards,

Kalpana.




Loader.
Up arrow icon