Yes - you should take a look at the onTimeRangeSelected event handler in your application.
By default, the calendar doesn't do anything when you select a time range (click a cell) so if you see a modal dialog there is already an onTimeRangeSelected handler that opens it. You can modify it as needed and open your own modal dialog instead.
Usually, it looks like this:
onTimeRangeSelected: async (args) => {
const modal = await DayPilot.Modal.prompt("Create a new event:", "Event 1");
const dp = args.control;
dp.clearSelection();
if (modal.canceled) { return; }
dp.events.add({
start: args.start,
end: args.end,
id: DayPilot.guid(),
text: modal.result
});
},
See also:
https://api.daypilot.org/daypilot-calendar-ontimerangeselected/