Allow only fullday events

Hi,

I want to make sure that users can add only fullday events. I’ve tried this:

scheduler.config.time_step = 60*24;
scheduler.config.event_duration = 60*24;

To make sure that nobody will add event from 2pm to 2pm next day becouse it will be two-days event. And this kind of works but it’s pretty ugly - fullday checkbox is unchecked and time values are empty. If someone check’s fullday it add one day and make event day longer.

Is there any way to make it work better.

Hi,
you can try to hide a time and second date selectors. Check this post, it describes the similar thing
viewtopic.php?f=6&t=34714&p=109405&hilit=one+date+in+lightbox#p109405

Thanks,

I’ve modified that code:

// fullday only
scheduler.attachEvent("onLightbox", function(){
  var node = scheduler.formSection("time").node;
  var sels = node.getElementsByTagName("select");
  var start = sels.length - 4;//'end_date' inputs
  sels[start].previousSibling.style.display='none';//hide 'dash'
  for (var i=start; i<sels.length; i++)
  sels[i].style.display="none";//hide selects
  
  $(".dhx_fullday").hide(); // hide fullday checkbox
  $(".dhx_section_time").css({
    "position" : "absolute",
    "left" : "120px"
  });
  $(".dhx_section_time select:first-child").hide(); // hide hours
});

That code hides blank space and make it looks better in my opinion.

But there is one more problem - in month view there is still possibility to drag over callendar and make more than one day events. Is there a simple way to disable that feature (draging in month view).

Thanks, swist

you can disable creating events by drag and drop when user switches to the month view, and keep it enabled for other views:scheduler.attachEvent("onViewChange", function (new_mode , new_date){ scheduler.config.drag_create = !(new_mode == "month"); });

docs.dhtmlx.com/scheduler/api__s … event.html
docs.dhtmlx.com/scheduler/api__s … onfig.html