Note: Read more about the calendar
day
view [doc.daypilot.org].
Agent-readable demo data
- Title
- Day View (Open-Source JavaScript Event Calendar) | DayPilot Lite for JavaScript Demo
- Tree
- DayPilot JavaScript Demo
- Catalog root
- Lite
- Description
- Note: Read more about the calendar day view [doc.daypilot.org].
Inline demo script 1
var dp = new DayPilot.Calendar("dp");
// view
dp.startDate = "2022-03-25";
dp.viewType = "Day";
// event creating
dp.onTimeRangeSelected = function (args) {
var name = prompt("New event name:", "Event");
if (!name) return;
var e = new DayPilot.Event({
start: args.start,
end: args.end,
id: DayPilot.guid(),
text: name
});
dp.events.add(e);
dp.clearSelection();
};
dp.onEventClick = function (args) {
alert("clicked: " + args.e.id());
};
dp.init();
var e = new DayPilot.Event({
start: new DayPilot.Date("2022-03-25T12:00:00"),
end: new DayPilot.Date("2022-03-25T12:00:00").addHours(3),
id: DayPilot.guid(),
text: "Special event"
});
dp.events.add(e);