calculateEndDate

calculates the end date of a task

Date calculateEndDate(object config);

Parameters

configobjectthe configuration object of a time span

Returns

Datethe date when a task is scheduled to be completed

Example

gantt.config.work_time = true;
gantt.init("gantt_here");
 
// calculate the end date using global worktime settings
gantt.calculateEndDate({start_date: new Date(2013,02,15), duration: 48});
// or
gantt.calculateEndDate(new Date(2013,02,15), 48);
 
// calculate end date for a specific task calendar
gantt.calculateEndDate({start_date: new Date(2013,02,15), duration: 48, task:task});
// or, a short form:
// will use calendar currently assigned to a task, task.start_date and task.duration
gantt.calculateEndDate(task);

Details

If the work_time option is enabled, the method considers duration as working time.

Configuration object properties

The configuration object can contain the following properties:

  • start_date - (Date) the date when a task is scheduled to begin
  • duration - (number) the duration of a task
  • unit - (string) optional, the time unit of the duration: "minute", "hour", "day", "week", "month", "year"
  • task - (object) optional, the object of the task the duration of which should be calculated
See also
Back to top