Skip to main content

getTaskBaselines

info

This functionality is available in the PRO edition only.

Description

Returns an array of baselines of a specific task from the datastore

getTaskBaselines: (taskId: string | number) => Baseline[]

Parameters

  • taskId - (required) string | number - the task id

Returns

  • param - (Baseline[]) - an array of baseline objects

Example

gantt.getTaskBaselines(5); // -> see details

Details

note

The getTaskBaselines method is not available if the baselines config is disabled.

The method returns an array with the baseline objects that have the following properties:

  • id - (string | number) - the baseline ID
  • task_id - (string | number) - the ID of the task the baseline belongs to
  • start_date - (Date) - the start date of the baseline
  • duration - (number) - the duration of the baseline
  • end_date - (Date | number) - the end date of the baseline
  • [customProperty: string] - (any) - any custom property
  • className - (string | number) - the value of this property is used by Gantt as a custom class for an HTML element

For example:

[
{
task_id: 5,
id: 1,
duration: 2,
start_date: "03-04-2019 00:00",
end_date: "05-04-2019 00:00"
},
{
task_id: 5,
id: 2,
duration: 1,
start_date: "06-04-2019 00:00",
end_date: "07-04-2019 00:00"
}
]

Change log

  • added in v9.0