본문으로 건너뛰기

end_date

Description

시간 척도의 종료 값을 설정합니다

end_date: Date | undefined

Example

gantt.config.start_date = new Date(2018, 08, 10);
gantt.config.end_date = new Date(2018, 08, 20);

gantt.init("gantt_here");

Details

노트

end_date 옵션을 적용하려면 start_date와 함께 사용해야 합니다.

  • 만약 두 옵션인 start_dateend_date 가 모두 지정되고, 범위를 벗어나는 작업을 만들면 차트에 표시되지 않습니다.
  • init 메서드의 Optional 매개변수는 start_dateend_date 구성의 초기 값으로 사용할 수 있습니다.
  • start_dateend_datefit_tasks를 덮어씁니다. 이러한 설정들을 함께 사용하려면, 코드를 통해 시간 척도를 관리해야 합니다 manage the time scale from code.

이 경우 범위를 확장할 수 있습니다:

gantt.attachEvent("onLightboxSave", function(id, task, is_new){
const taskStart = task.start_date;
const taskEnd = task.end_date;
const scaleStart = gantt.config.start_date;
const scaleEnd = gantt.config.end_date;

// if the task is out of the range
if(scaleStart > taskEnd || scaleEnd taskEnd || scaleEnd < taskStart ){
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.