search envelope-o feed check
Home Unanswered Active Tags New Question
user comment-o

Custom timeHeaders

Asked by Anonymous
4 years ago.

Hi. Why i don't see "1st" in time header ???

...............
..................
dp.startDate = new DayPilot.Date();
dp.days = 200;
dp.timeHeaders = [
{ groupBy: "None", format: "" },
{ groupBy: 'Week' }
];
dp.onBeforeTimeHeaderRender = function (args) {
if (args.header.level === 0) {
args.header.areas = [{ start: new DayPilot.Date().addDays(10), end: new DayPilot.Date().addDays(20), html: "1st" },
{ start: new DayPilot.Date().addDays(20), end: new DayPilot.Date().addDays(30), html: "2nd" },
{ start: new DayPilot.Date().addDays(30), end: new DayPilot.Date().addDays(40), html: "3rd" },
{ start: new DayPilot.Date().addDays(40), end: new DayPilot.Date().addDays(50), html: "4rd" }
];
args.header.html = "";
}
if (args.header.level === 1) {
args.header.html = args.header.start.toString("d MMM") + " - " + args.header.end.toString("d MMM");
}
};
dp.scale = "Week";
........
........
......

Answer posted by Dan Letecky [DayPilot]
4 years ago.

Do you use the latest DayPilot version? The start/end properties for time header active areas are available since version 8.1 (build 8.1.1757).

If I add your code to demo/scheduler/index.html it seems to work fine.

This question is more than 3 months old and has been closed. Please create a new question if you have anything to add.