How do I get the time on FullCalendar only? I'm using FullCalendar to register the events. The fields are:
Title, Event Color, Date, Time, Description
In the database, it is being registered as follows:
OnlywhenIedit,itappearswiththewrongtime,see:
Lookatthecodeinthetimezone,Itriedtoputid="hour" , but it does not seem to be 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 a variable in FullCalendar, or is there any way to get only the time?