1
How do I pick only the time in Fullcalendar? I’m using Fullcalendar to register events. The fields are:
Title, Event Color, Date, Time, Description
In the database, it is being registered as follows:
Only when I edit it, it shows up at the wrong time, look:
Look at the code on the schedule, I tried to put id="hour", but it doesn’t seem to exist in Fullcalendar:
HTML
<div class="md-input-wrapper">
<input type="text" id="hour" name="Hora" data-mask="99:99" class="md-form-control md-static hour" placeholder="Coloque o horário inicial do evento" value="<?php echo date("H:i"); ?>" required>
<label id="tipoEnvio">Hora:</label>
</div>
Jquery
<script src="fullcalendar/moment.min.js"></script>
<script src="fullcalendar/fullcalendar.min.js"></script>
<script src='fullcalendar/locale/pt-br.js'></script>
<script>
$(document).ready(function() {
var calendar = $('#calendar').fullCalendar({
validRange: {
start: '<?php echo date("Y-m-d"); ?>'
},
header: {
left: 'prev,next today',
center: 'title',
right: 'month,agendaWeek,agendaDay'
},
defaultDate: Date(),
navLinks: true,
editable: true,
eventLimit: true,
eventClick: function(event) {
$('#visualizar #id').text(event.id);
$('#visualizar #id').val(event.id);
$('#visualizar #title').text(event.title);
$('#visualizar #title').val(event.title);
$('#visualizar #start').text(event.start.format('DD/MM/YYYY HH:mm:ss'));
$('#visualizar #start').val(event.start.format('DD/MM/YYYY HH:mm:ss'));
$('#visualizar #color').val(event.color);
$('#visualizar #description').val(event.description);
$('#visualizar').modal('show');
calendar.fullCalendar('refetchEvents');
return false;
}
....
PHP
$data = array();
....
while($listar = mysqli_fetch_array($sqlVisualizar)) {
list($dia,$mes,$ano) = explode("/",$listar["DataAgenda"]);
$dataEvento = $ano."-".$mes."-".$dia;
$linhas['id'] = $listar["IdAgenda"];
$linhas['title'] = $listar["Titulo"];
$linhas['start'] = $listar["DataAgenda"];
$linhas['color'] = $listar["CorAgendamento"];
$linhas['description'] = $listar["Conteudo"];
array_push($data,$linhas);
}
return json_encode($data,JSON_UNESCAPED_SLASHES);
Is there any variable in Fullcalendar or some way to get only the time?