This Scheduler configuration uses a grid that shows one week per cell. Read more about the
scheduler
scale [doc.daypilot.org].
Agent-readable demo data
- Title
- Time Scale: Weeks (JavaScript Scheduler) | DayPilot Pro for JavaScript Sandbox
- Tree
- DayPilot JavaScript Sandbox
- Catalog root
- Default
- Description
- This Scheduler configuration uses a grid that shows one week per cell. Read more about the scheduler scale [doc.daypilot.org].
Inline demo script 1
const dp = new DayPilot.Scheduler("dp", {
startDate: new DayPilot.Date("2026-01-01"),
days: new DayPilot.Date("2026-01-01").daysInYear(),
timeHeaders: [
{groupBy: "Month"},
{groupBy: "Week"}
],
scale: "Week",
treeEnabled: true,
resources: [
{name: "Room A", id: "A"},
{name: "Room B", id: "B"},
{name: "Room C", id: "C"},
{name: "Room D", id: "D"},
{name: "Room E", id: "E"},
{name: "Room F", id: "F"},
{name: "Room G", id: "G"},
{name: "Room H", id: "H"},
{name: "Room I", id: "I"},
{name: "Room J", id: "J"},
{name: "Room K", id: "K"},
],
onTimeRangeSelected: async args => {
const modal = await DayPilot.Modal.prompt("New event name:", "Event");
dp.clearSelection();
if (modal.canceled) return;
dp.events.add({
start: args.start,
end: args.end,
id: DayPilot.guid(),
resource: args.resource,
text: modal.result
});
dp.message("Created");
},
/*
onBeforeTimeHeaderRender: args => {
if (args.header.level === 1) {
args.header.html = args.header.end.toString("yy") + " W" + args.header.end.weekNumberISO();
}
}
*/
});
dp.init();