Gantt chart cannot handle null dates?

Hi,


Is the Gantt able to show data fields, which has null value, but field type is date?


export let projectNewData = [ { TaskID: 1, TaskName: 'Product concept', StartDate: new Date('04/02/2019'), EndDate: new Date('04/21/2019') },  { TaskID: 2, TaskName: 'Product design', StartDate: null, EndDate: null }


Setting the above as GanttComponent dataSource, the GanttComponent does not seem to be able to render blank for Task 2 dates. Can you please advise how to configure so that StartDate and EndDate display as blank, for Task 2?


Thanks


4 Replies

March 26, 2024 07:24 AM UTC

Any options or workarounds?



SJ Sridharan Jayabalan Syncfusion Team March 26, 2024 01:13 PM UTC

Hi Devy,

 

Greetings from Syncfusion.

 

We have displayed the StartDate and EndDate as blank (with null values as well as empty string) as per your code example for both Grid and Gantt Chart components, but we are unable to replicate any issue at our end (It displays only blank values).

 

Code-Snippet:

let editingData = [

  {

    TaskID: 1,

    TaskName: 'Product concept',

    StartDate: new Date('04/02/2019'),

    EndDate: new Date('04/21/2019'),

  },

  { TaskID: 2, TaskName: 'Product design', StartDate: '', EndDate: '' },

];

 

 

 

 

We need some more additional information about the issue. kindly share us the asked details below.

 

  1. Complete Gantt Chart code details.
  2. Share time zone details ?
  3. Have you rendered the Gantt chart with Remote Data?
  4. If possible replicate the issue in the attached sample and revert us back.

 

Sample - Ckpszw (forked) - StackBlitz

 

 

Regards,

Sridharan



March 26, 2024 01:49 PM UTC

Thanks Sridharan - we had also found the missing property that needed to be set, which was "

allowUnscheduledTasks"



SJ Sridharan Jayabalan Syncfusion Team March 27, 2024 04:31 PM UTC

Devy,

 

For your query, if the option "allowUnscheduledTasks" is set to true, null fields are allowed in the start and end date cells. Otherwise, the Gantt chart will automatically calculate the dates based on other parameters. Therefore, we recommend setting "allowUnscheduledTasks" to true to render the start and end date cells empty when needed.

 

Sample - Ckpszw (forked) - StackBlitz

Demo - Gantt Chart · Unscheduled Tasks · Syncfusion React UI Components

Documentation - Task scheduling in React Gantt component | Syncfusion

 

If we misunderstood your query share us more details.

 

Regards,

Sridharan


Loader.
Up arrow icon