Full Calendar does not respect end date

0

I created a calendar using Full Calendar, it displays the events, but does not respect the end date, always ends the event the day before, but only on the display. I do not know if this duration field is being respected, but should respect the end field. Here is the code that searches and mounts json:

$conexao = new PDO('', '', '');
  if(!$conexao){
  echo "<script> window.location.replace('../erro.html'); </script>"; 
}

$consulta = $conexao->query("SELECT id, title, start, end, datediff(ADDDATE( end, INTERVAL 1 DAY), start) as duration FROM eventos");
    while ($linha = $consulta->fetch(PDO::FETCH_ASSOC)) { 
        $vetor[] = $linha;        
     }
    //Passando vetor em forma de json
    echo json_encode($vetor);

Thank you if anyone has any suggestions on how to fix it.

js:

<script>
    $(document).ready(function() {  

            //CARREGA CALENDÁRIO E EVENTOS DO BANCO
            $('#calendario').fullCalendar({
                header: {
                    right: 'prev,next',
                    center: 'title',
                    left: 'month,agendaWeek,agendaDay'
                },
                //defaultDate: '2016-01-12',
                editable: true,
                eventLimit: true, 
                events: 'eventos.php',           
                eventColor: '#0277BD'
            }); 
    }); 

    </script> 
    
asked by anonymous 06.04.2017 / 18:51

1 answer

5

If you look in the documentation you will see that the last day is EXCLUSIVE which means that the day of the end does not count. For example, if your event ends Monday, the end date should be Tuesday at 00:00 for the second to be counted.

The END is the time immediately after the event is over.

    
27.04.2017 / 00:36