You can use the following config:
var dp = new DayPilot.Scheduler("dp", {
// ...
cellDuration: 720,
cellWidth: 40,
scale: "CellDuration",
timeHeaders: [{groupBy: "Day", format: "dddd MMMM d, yyyy"}, {groupBy: "Hour"}, {groupBy: "Cell"}],
zoomLevels: [
{
name: "Day",
properties: {
startDate: function(args) { return args.date.getDatePart(); },
days: function() { return 2; },
}
},
{
name: "Week",
properties: {
startDate: function(args) { return args.date.firstDayOfWeek(); },
days: function() { return 7; },
}
},
],
});
And buttons:
HTML
<div class="toolbar">
<button id="button-day">Day</button>
<button id="button-week">Week</button>
</div>
JavaScript
<script>
var elements = {
day: document.getElementById("button-day"),
week: document.getElementById("button-week"),
};
elements.day.addEventListener("click", function(ev) {
dp.zoom.setActive(0);
});
elements.week.addEventListener("click", function(ev) {
dp.zoom.setActive(1);
});
</script>
In this case (one cell per 12 hours), you don't need to use loadTimeline because that is used to generate a custom timeline.