It depends on how you are creating a new event. If it's directly on TimeRangeSelected it could look like this:
TimeRangeSelectedHandling="JavaScript"
TimeRangeSelectedJavaScript="check(start, end, resource)"
<script style="text/javascript">
function check(start, end, resource) {
var now = new DayPilot.Date();
// var today = now.getDatePart();
if (end.getTime() < now.getTime()) {
if (!(confirm('Are you sure that you want to create an event in the past?')) {
return;
}
}
dpc.timeRangeSelected(start, end, resource);
}
</script>