If you click a calendar cell, it will fire onTimeRangeSelect (and onTimeRangeSelected) event handler where you can create a new event. This works in both versions (Lite and Pro).
To make sure only a 30-minute event (for example) is created, you can use a calculated end instead of the provided args.end.
onTimeRangeSelected: args => {
dp.events.add({
start: args.start,
end: args.start.addMinutes(30),
// ...
});
}
In the Pro (paid) version, you can prevent a selection of multiple cells using onTimeRangeSelecting (since 2023.1.5536):
onTimeRangeSelecting: args => {
if (args.anchor === args.start) {
args.end = args.start.addMinutes(30);
}
else {
args.start = args.end.addMinutes(-30);
}
}
This will modify the visible selection and onTimeRangeSelected will receive the modified range.
See also:
https://api.daypilot.org/daypilot-calendar-ontimerangeselecting/
The onTimeRangeDoubleClicked event only works on an existing selection and is only available in the Pro version.