Prevent the user from stretching the event to other days

0

How do I prevent the user from stretching the event for other days without interfering with date editing?

$('#calendario').fullCalendar({

            editable: true, // continuar editável!
            eventLimit: true,
            events: 'eventos.php',
            eventColor: '#dd6777',
.....
    
asked by anonymous 02.07.2017 / 13:13

2 answers

0

You can check the Calendar eventResize if the start day of the selected event is different from the final day of the selection, using the moment.js library to get the day. If both are on the same day, it lets you edit, if not, it cancels the action.

An example:

$('#calendar').fullCalendar({
    ...
    eventResize: function( event, delta, revertFunc, jsEvent, ui, view ) {
        //Se o dia do inicio da seleção for diferente do dia do final
        //da seleção, ele cancela o resize. Voce pode aplicar essa 
        //lógica para outras edições do usuario, como select por exemplo
        if(moment(event.start).date()!=moment(event.end).date()){
            revertFunc();
        }
    }
});
    
07.09.2017 / 06:12
0
/** desabilita drag-n-drop end resise **/
editable: false,

/** habilita evento drag-n-drop **/
 eventStartEditable  : true,
    
22.09.2017 / 18:12