Page 1 of 1

[REACT] About the inconsistency between the time of the data and the time on the Gantt chart

Posted: Wed Aug 10, 2022 11:14 am
by caiyuan

The timing of the tasks data is like this
Image

But the rendered time looks like this
Image

why?


Re: [REACT] About the inconsistency between the time of the data and the time on the Gantt chart

Posted: Wed Aug 10, 2022 11:54 am
by mats

Try with endDate set to same format as startDate:

endDate : '2019-02-09'

Re: [REACT] About the inconsistency between the time of the data and the time on the Gantt chart

Posted: Wed Aug 10, 2022 12:02 pm
by caiyuan
{
    id: 999,
    name: 'Launch SaaS Product',
    percentDone: 50,
    startDate: '2019-01-24',
    expanded: true,
    children: [
      {
        id: 111111111,
        name: 'Setup web server',
        percentDone: 50,
        duration: 10,
        startDate: '2019-01-28',
        rollup: false,
        endDate: '2019-02-09',
        expanded: true,
      },
      {
        id: 22222,
        name: 'Setup web server2222',
        percentDone: 50,
        duration: 10,
        startDate: '2019-02-28',
        rollup: true,
        endDate: '2019-03-09',
        expanded: true,
      },
      {
        id: 333333,
        name: 'Setup web server3333',
        percentDone: 50,
        duration: 10,
        startDate: '2019-04-28',
        rollup: true,
        endDate: '2019-05-09',
        expanded: true,
      },
    ],
  },

Image

It's not a date format problem, using this code for Gantt chart rendering, the display effect is the effect of this image.

Setup web server3333 The time of this task is obviously different from the time in the code.


Re: [REACT] About the inconsistency between the time of the data and the time on the Gantt chart

Posted: Wed Aug 10, 2022 12:15 pm
by Animal

What if you add

manuallyScheduled: true

to the data block of Setup web server3333?


Re: [REACT] About the inconsistency between the time of the data and the time on the Gantt chart

Posted: Wed Aug 10, 2022 12:19 pm
by caiyuan

It is ok.
I added the code

manuallyScheduled: true

Re: [REACT] About the inconsistency between the time of the data and the time on the Gantt chart

Posted: Sun Aug 14, 2022 4:42 am
by caiyuan

Still having problems using manual scheduling, that's completely manual between tasks, which isn't what I want either. I just want the tasks not to be automatically scheduled to the start time of the parent task.


Re: [REACT] About the inconsistency between the time of the data and the time on the Gantt chart

Posted: Mon Aug 15, 2022 4:54 am
by arcady

An automatically scheduled task position is calculated ..even though you provide its start/end dates they are revalidated.

If manual task is not what you want try using constraints:

startDate : "2019-01-28",
constraintType : "startnoearlierthan",
constraintDate : "2019-01-28",

More info on task scheduling principles: https://www.bryntum.com/docs/gantt/guide/engine/gantt_events_scheduling (this chapter describes constraints effect)
Fields docs:
https://www.bryntum.com/docs/gantt/api/Gantt/model/TaskModel#field-constraintType
https://www.bryntum.com/docs/gantt/api/Gantt/model/TaskModel#field-constraintDate