dayClick FullCalendar

5

Can you avoid opening the prompt(modal) insert new event to click on a day in monthView ? I got it to go to the date clicked on agendaWeek but it keeps opening prompt to insert new event.

CODE:

dayClick: function(date, jsEvent, view){
    //não abrir o prompt de inserção
    //no caso eu quero apenas que vá para a agendaWeek na data clicada
    $("#calendar").fullCalendar('changeView','agendaWeek');
    $("#calendar").fullCalendar('gotoDate',date);
}
    
asked by anonymous 25.11.2015 / 12:19

1 answer

3

I got the answer here .

What happens is that I have to check at the time of the dayClick if the current view is the 'month' and make the prompt open if it is not.

select: function(start, end) {
    if($('#calendar').fullCalendar('getView').type != 'month'){
        //ele somente entra para cadastrar se a view não for a 'month'.
    }
    else{
        //se for a 'month view' ele passa pelo if e entra neste else, alterando entao a view para agendaWeek e, portanto, nao abrindo o prompt de inserção
        $("#calendar").fullCalendar('changeView','agendaWeek');
    }
}
    
27.11.2015 / 11:55