You can enable support for all-day events that will be displayed in the top header row of the Calendar component.
Read more about the
all-day
events [doc.daypilot.org].
Agent-readable demo data
- Title
- All-Day Events (JavaScript Calendar) | DayPilot Pro for JavaScript Demo
- Tree
- DayPilot JavaScript Demo
- Catalog root
- Default
- Description
- You can enable support for all-day events that will be displayed in the top header row of the Calendar component.
Read more about the all-day events [doc.daypilot.org].
Inline demo script 1
const dp = new DayPilot.Calendar("dp", {
startDate: DayPilot.Date.today(),
viewType: "Week",
showAllDayEvents: true,
onTimeRangeSelected: async args => {
const modal = await DayPilot.Modal.prompt("New event name:", "Event");
if (modal.canceled) return;
dp.events.add({
start: args.start,
end: args.end,
id: DayPilot.guid(),
resource: args.resource,
text: modal.result
});
dp.clearSelection();
dp.message("Created");
},
eventClickHandling: "Edit",
allDayEnd: "Date",
});
dp.init();
const app = {
init() {
this.loadEventData();
},
loadEventData() {
const events = [
{
start: DayPilot.Date.today().firstDayOfWeek().addDays(1).addHours(11),
end: DayPilot.Date.today().firstDayOfWeek().addDays(1).addHours(14),
id: DayPilot.guid(),
text: "Event 1"
},
{
start: DayPilot.Date.today().firstDayOfWeek().addDays(1),
end: DayPilot.Date.today().firstDayOfWeek().addDays(3),
id: DayPilot.guid(),
text: "All-Day Event",
allday: true,
},
];
dp.update({events});
}
};
app.init();