The timeHeaders property (array) specifies the time header rows, including their grouping and date format.
DayPilot.Gantt.timeHeadersgroupBy (string) specifies the group size used for the row.
format (string) specifies the date/time format used for the row text; optional.
[
{ "groupBy": "Month", "format": "MMMM yyyy" },
{ "groupBy": "Day", "format": "d" }
]Each array item defines one time header row.
groupBy supports the following values:
"Default" uses the value specified by DayPilot.Gantt.cellGroupBy for backwards compatibility.
"Cell" uses a group size that corresponds to the cell size defined by DayPilot.Gantt.scale.
"Hour" groups the row by hour.
"Day" groups the row by day.
"Week" groups the row by week.
"Month" groups the row by month.
"Year" groups the row by year.
"None" disables grouping for the row.
The format value uses the pattern variables supported by DayPilot.Date.toString().
JavaScript
const gantt = new DayPilot.Gantt("dp", {
timeHeaders: [
{ groupBy: "Month", format: "MMMM yyyy" },
{ groupBy: "Day", format: "d" },
{ groupBy: "Hour", format: "h" }
],
// ...
});
gantt.init();Angular
<daypilot-gantt [config]="config"></daypilot-gantt>config: DayPilot.GanttConfig = {
timeHeaders: [
{ groupBy: "Month", format: "MMMM yyyy" },
{ groupBy: "Day", format: "d" },
{ groupBy: "Hour", format: "h" }
],
// ...
};React
<DayPilotGantt
timeHeaders={[
{ groupBy: "Month", format: "MMMM yyyy" },
{ groupBy: "Day", format: "d" },
{ groupBy: "Hour", format: "h" }
]}
{/* ... */}
/>Vue
<DayPilotGantt
:timeHeaders="[
{ groupBy: 'Month', format: 'MMMM yyyy' },
{ groupBy: 'Day', format: 'd' },
{ groupBy: 'Hour', format: 'h' }
]"
<!-- ... -->
/>Time Header Rows [doc.daypilot.org]