The tasks.businessEnd() returns the adjusted end date of a task:
Starts with the task’s current start date and its business-only duration.
Scans the resulting date range for any cells marked non-business (weekends, holidays, etc.).
Shifts the end date forward by the length of every non-business interval it encounters, so that the total business duration is preserved.
Returns the final end date that now fully covers the original business duration plus any skipped non-business time.
The non-business cells can be defined using the onBeforeCellRender event handler.
Available since 2025.3.6564.
DayPilot.Gantt.tasks.businessEnd(task, duration)task (DayPilot.Task) - the task for which the business end is calculated (only the start value is used)
duration (DayPilot.Duration) - the business-only duration
DayPilot.Date object
or null if the specified tasks doesn’t belong to the Gantt chart component
const gantt = new DayPilot.Gantt("dp", {
// ...
});
gantt.init();
const duration = gantt.tasks.businessDuration(1);
const end = gantt.tasks.businessEnd(1, duration);
console.log(end);Business Hours [doc.daypilot.org]