Перейти к основному содержимому

start_date

Description

Устанавливает начальное значение шкалы времени

start_date: Date | undefined

Example

gantt.config.start_date = new Date(2027, 8, 10);
gantt.config.end_date = new Date(2027, 8, 20);

gantt.init("gantt_here");

Details

заметка

Чтобы применить опцию start_date, нужно использовать ее вместе с end_date.

В этом случае мы можем расширить диапазон:

gantt.attachEvent("onLightboxSave", (taskId, task, isNew) => {
const taskStartDate = task.start_date;
const taskEndDate = task.end_date;
const scaleStartDate = gantt.config.start_date;
const scaleEndDate = gantt.config.end_date;

if (scaleStartDate > taskEndDate || scaleEndDate < taskStartDate) {
gantt.message({ type: "warning", text: "Warning! The task is outside the date range!", expire: 5000 });

return false;
}

return true;
});
Need help?
Got a question about the documentation? Reach out to our technical support team for help and guidance. For custom component solutions, visit the Services page.