Our state of the art Gantt chart


Post by rdonahue6 »

We are upgrading from Ext Gantt to Bryntum Gantt 6.3.2,
we have added Gantt like below :

 ganttView = new Gantt({
                    taskRenderer: ({ taskRecord, renderData }) => {
                       
return taskRecord.isMilestone ? '' : taskRecord.percentDone + '%'; }, project: { stm: { autoRecord: true }, autoSetConstraints: true, tasks: [ { id: 1, name: 'Write docs', expanded: true, children: [ { id: 2, name: 'test1', startDate: '2022-01-02', endDate: '2022-01-09' }, { id: 3, name: 'test2', startDate: '2022-01-09', endDate: '2022-01-10' } ] } ], dependencies: [ { fromTask: 2, toTask: 3 } ] }, showDirty: { duringEdit: true }, labels: true, features: { filter: true, labels: { right: { renderer: function ({ taskRecord }) { let right = NewGanttUtil.getGanttLabel(taskRecord, true) return right; } }, left: { renderer: function ({ taskRecord }) { let left = NewGanttUtil.getGanttLabel(taskRecord, false); return left; } } }, progressLine: { disabled: true }, baselines: { disabled: true }, criticalPaths: { disabled: true }, rollups: true, print: true, dependencyEdit: true, dependencies: { showTooltip: false, clickWidth: 5, radius: 10, terminalOffset: 0, terminalSize: 12, }, }, // project: projectData, subGridConfigs: { locked: { width: 500 } }, columns: [ { type: 'wbs', hidden: true, sortable: false }, { type: 'name', width: 250, sortable: false }, { type: 'duration', sortable: false }, { type: 'startdate', sortable: false }, { type: 'enddate', sortable: false }, { type: 'percentdone', mode: 'circle', width: 70, sortable: false }, { type: 'predecessor', sortable: false, width: 112, renderer: ({ record }) => { let predecessors = record.predecessors; if (predecessors.length) { var toBeRendered = new Array(); for (const predecessor of predecessors) { let lag = predecessor.get('lag'); let lagSymbol = parseInt(lag) >= 0 ? '+' : ''; let display = predecessor.get('predTaskSeqNumber') + ':' + predecessor.get('DependencyType') + lagSymbol + lag + ' ' + predecessor.get('lagUnit'); toBeRendered.push(display); // return display; } return toBeRendered.join(','); } } }, // { type: 'successor', width: 112 }, { type: 'constrainttype', sortable: false }, { type: 'constraintdate', sortable: false }, ], selectionMode: { cell: true, dragSelect: true, rowNumber: true }, });

However, when we click on start date column to edit, getting below error,

gantt.umd.js?debug_m…rojectWidget1:95032 Uncaught Error: CalendarPanel date ingestion must be passed a Date, or a YYYY-MM-DD date string
at SchedulerDatePicker.changeDate (gantt.umd.js?debug_m…ectWidget1:95032:17)
at SchedulerDatePicker.changeMinDate (gantt.umd.js?debug_m…ctWidget1:100115:62)
at SchedulerDatePicker.set (gantt.umd.js?debug_m…jectWidget1:4110:48)
at SchedulerDatePicker.set (gantt.umd.js?debug_m…jectWidget1:4183:24)
at SchedulerDatePicker.setConfig (gantt.umd.js?debug_m…jectWidget1:5540:21)
at SchedulerDatePicker.configure (gantt.umd.js?debug_m…jectWidget1:5393:12)
at SchedulerDatePicker.construct (gantt.umd.js?debug_m…jectWidget1:5036:16)
at SchedulerDatePicker.construct (gantt.umd.js?debug_m…ectWidget1:18134:15)
at SchedulerDatePicker.construct (gantt.umd.js?debug_m…jectWidget1:7479:15)
at SchedulerDatePicker.construct (gantt.umd.js?debug_m…ectWidget1:59283:15)


Post by ahmadzaheer »

Hello,

I have tried the same configs that you have mentioned but these are working fine for me on version 6.3.2. Can you please share the OS, browser and browser version that you are using?

Regards,
Ahmad Zaheer


Post by rdonahue6 »

OS : Windows 11
Google Chrome :Version 146.0.7680.178


Post by mats »

Could get a full test case, small app based on our basic samples?


Post by rdonahue6 »

Hi,

Unfortunately, we are not able to reproduce it on examples.
However, attaching our analysis done after debugging.
Hope, with this information, you can give some pointers on what are we doing wrong.

Following is the JSON which we feed to GanttChart.

{
    "id": "1",
    "startDate": "2026-04-15",
    "endDate": "2026-04-20",
    "duration": 5,
    "durationUnit": "day",
    "cls": "",
    "name": "Simple Project",
    "calendar": null,
    "ignoreResourceCalendar": null,
    "constraintType": "As Soon As Possible",
    "constraintDate": "2026-04-10",
    "inactive": false,
    "delayFromParent": null
}

Thanks,

Attachments
DatePicker Issue for startDate and endDate.png
DatePicker Issue for startDate and endDate.png (117.14 KiB) Viewed 6698 times

Post by alex.l »

Hi,

Do you see in a call stack how do we get empty objects instead of valid Date or String that can be parsed to Date? All good with types and formats in your initial configs and data loaded?

All the best,
Alex Lazarev

How to ask for help? Please read our Support Policy


Post by rdonahue6 »

Hi alex,

Do you see in a call stack how do we get empty objects instead of valid Date or String that can be parsed to Date?
Pravin:
Yes, as soon as i click on DatePicker of startDate, on very first line of call stack, minDate and maxDate are empty objects.
However, for Constraint Date, null values are received for these fields.
Please refer attached screenshots of start Date and Constraint Date.

All good with types and formats in your initial configs and data loaded?
Pravin: Yes, same format and values are sent to start date, end date and constraint date. GanttChart renders correctly with this data.

Here is the JSON formatted data

[
    {
        "id": "1",
        "parentIndex": 0,
        "expanded": true,
        "startDate": "2026-04-15T08:00:00+05:30",
        "endDate": "2026-04-20T08:00:00+05:30",
        "duration": 5,
        "durationUnit": "day",
        "cls": "",
        "name": "Simple Project",
        "calendar": null,
        "direction": null,
        "ignoreResourceCalendar": null,
        "percentDone": 0,
        "effort": 0,
        "effortUnit": "hour",
        "effortDriven": false,
        "schedulingMode": "Normal",
        "segments": null,
        "constraintType": "As Soon As Possible",
        "constraintDate": "2026-04-10T07:20:00+05:30",
        "inactive": false,
        "delayFromParent": null,
        "projectConstraintResolution": "honor",
        "baselines": [],
    },
    {
        "id": "2",
        "parentIndex": 0,
        "expanded": false,
        "startDate": "2026-04-15T08:00:00+05:30",
        "endDate": "2026-04-20T08:00:00+05:30",
        "duration": 5,
        "durationUnit": "day",
        "cls": "",
        "name": "T-0000100",
        "calendar": null,
        "direction": null,
        "manuallyScheduled": false,
        "unscheduled": false,
        "ignoreResourceCalendar": null,
        "percentDone": 0,
        "effort": null,
        "effortUnit": "hour",
        "effortDriven": false,
        "schedulingMode": "Normal",
        "segments": null,
        "constraintType": "Start No Earlier Than",
        "constraintDate": "2026-04-15T08:00:00+05:30",
        "inactive": null,
        "delayFromParent": null,
        "projectConstraintResolution": "honor",
        "baselines": [],
    }
]
Attachments
Constraint Date DatePicker debug
Constraint Date DatePicker debug
Constraint Date Config.png (35.78 KiB) Viewed 5737 times
End Date DatePicker debug
End Date DatePicker debug
End Date Config.png (81.21 KiB) Viewed 5737 times

Post by mats »

Hi there,


Thanks for the follow-up and for digging into the call stack, that detail about minDate/maxDate arriving as empty objects {} was the key clue.


We've pushed a defensive fix: https://github.com/bryntum/support/issues/12988). The DatePicker.changeMinDate / changeMaxDate handlers now reject anything that
isn't a valid Date (including

{}

, Invalid Date, arrays, etc.) and treat it the same as "no min/max" — so the picker will no longer throw, even if an unexpected value reaches it.


However, I still can't reproduce the {} from the config you've shared so far (neither with plain YYYY-MM-DD strings nor with the ISO 8601 +05:30 format). The fix above prevents the
crash, but something in your setup is producing those empty objects, and it would be good to understand what, it might point to a config issue on your end that's worth cleaning up, or to another library bug we should also fix.


Could you share one of the following so we can trace the source?

  • A stripped-down, runnable reproduction (e.g. a zip or CodePen based on one of our vanilla examples) that reproduces the crash

  • Or a screen recording showing the full browser devtools call stack (with the minDate: {} / maxDate: {} frame expanded and the file/line info visible)


    If neither is easy, even a paste of:

  • your full Gantt config (project options, columns, model definitions, any custom editor configs on the columns)

  • the TaskModel / ProjectModel classes if you've subclassed them


    …would help me retrace how {} ends up flowing into the picker.


    The defensive fix will ship in the next release regardless.


    Thanks!


Post by rdonahue6 »

Hi mats,

Thanks for quick reply and raising the bug.
After further analysis, adding editor with min max fields field for startdate and enddate resolves the issue.

{ type: 'duration', sortable: false },
{ type: 'startdate', sortable: false, editor : {type : 'date',min  : null,max  : null}},
{ type: 'enddate',   sortable: false, editor : {type : 'date',min  : null,max  : null}},

Sorry again that I couldn't reproduce issue on given examples.

BTW, we upgraded library to 7.2.2 now.

Thanks,
Pravin

Attachments
After editor field added to startdate and enddate.png
After editor field added to startdate and enddate.png (23.61 KiB) Viewed 5266 times

Post by rdonahue6 »

Hi mats,

Got the exact root cause of the problem.
Please refer attached screenshot for same.

Following are the known issues because of it, these are fixed by moving if (Objects.isDate(value)) before if (Objects.isObject(value)) in clone().

  • DatePicker was not appearing/working for start date and end date columns.

  • Non working days were not reflecting on UI even if setting nonWorkingTime and provided calendar configuration.

  • Receiving following exception when overing mouse on Chart, task/project bar or double click on task/project bar.

gantt.umd.js?debug_me&v=ProjectWidget1:26122 Uncaught TypeError: time.getTimezoneOffset is not a function
at DateHelper.snap (gantt.umd.js?debug_me&v=ProjectWidget1:26122:36)
at DateHelper.floor (gantt.umd.js?debug_me&v=ProjectWidget1:26043:21)
at TimeAxis.floorDate (gantt.umd.js?debug_me&v=ProjectWidget1:180414:29)
at new TimelineContext (gantt.umd.js?debug_me&v=ProjectWidget1:182156:31)
at Gantt.buildTimelineContext (gantt.umd.js?debug_me&v=ProjectWidget1:182556:20)
at Gantt.getTimelineEventContext (gantt.umd.js?debug_me&v=ProjectWidget1:182611:25)
at Gantt.handleScheduleEvent (gantt.umd.js?debug_me&v=ProjectWidget1:182460:36)
at HTMLDivElement.handler (gantt.umd.js?debug_me&v=ProjectWidget1:13532:61)

However, i am still wondering why is it not reproducible on any of the examples ? Is there something that I am doing wrong ?

Bryntum Gantt Version: 7.2.2
Browser: Chrome

Thanks,
Pravin

Attachments
Exact Root Cause.png
Exact Root Cause.png (95.53 KiB) Viewed 5016 times

Post Reply