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>