DayPilot.Gantt.timeline

Array that specifies a custom Gantt timeline.

Declaration

DayPilot.Gantt.timeline (array)

Description

Item properties:

  • start (DayPilot.Date or string in ISO 8601 format)
  • end (DayPilot.Date or string in ISO 8601 format)
  • width (int; width in pixels; optional)

Example 1

gantt.timeline = [
  { start: "2014-01-01T00:00:00", end: "2014-01-02T00:00:00" },
  { start: "2014-01-02T00:00:00", end: "2014-01-03T00:00:00" }
];

Example 2

gantt.timeline = [];

for (var i = 0; i < 31; i++) {
  var day = {};
  day.start = gantt.startDate.addDays(i);
  day.end = day.start.addDays(1);
  gantt.timeline.push(day);
}

for (var i = 0; i < 3; i++) {
  var month = {};
  month.start = gantt.startDate.addDays(31).addMonths(i);
  month.end = month.start.addMonths(1);
  month.width = 100;
  gantt.timeline.push(month);
}