How to validate the increase of days with FULL CALENDAR?

0

With the documentation of fullcalendar I have taken the following function:

   eventResize: function(event, delta, revertFunc)
                    {
                        var id =  event.id;
                        var fi = event.start.format();
                        var ff = event.end.format();  
                        var titulo = event.title;                           
                    }

This function helps me to extend the date or event to the desired date, the problem is that I can not find a way to validate, if the final date is greater than 7 days from the initial date that an error appears .

I tried:

    if(ff > 7)
    {
     alert("No puede sobre pasar los 7  dias");
    }
y esto
var fecha_de_validacion = moment.format('YYYY-MM-DD' + (parseInt(7)));

but it does not work

    
asked by JDavid 05.06.2017 в 18:47
source

1 answer

2

Do not use the event as a reference. Use delta . As the documentation says, this is a duration element that indicates how far the event has stretched.

If we transform to days , you can use:

if(delta.asDays() > 7){
    alert("No puede sobrepasar los 7  días");
}
    
answered by 10.08.2017 / 15:45
source