Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

333
Visualizações
Uncaught TypeError: Cannot read properties of undefined (reading 'hasTime') in fullcalendar

have facing error on full calendar display. I received JSON from a servlet in the following formats.

Type1: [["title2","2021-09-10","2021-09-10"],["title2","2021-09-10","2021-09-10"],

Type2: [["title2","2021-09-10","2021-09-10"],["title2","2021-09-10","2021-09-10"]]

Here's the error I see in Google chrome's console:

My Chrome console error image

My code:

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.29.1/moment.min.js"></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/fullcalendar/3.1.0/fullcalendar.js'></script>
<link rel='stylesheet' href="https://cdnjs.cloudflare.com/ajax/libs/fullcalendar/3.1.0/fullcalendar.min.css" />

<div id='calendar'></div>
$(document).ready(function() {
  var s = '';
  var value;
  var datavlue;
  
  $.ajax({
    url: 'CalendarEventController',
    dataType: "json",
    success: function(response) {
      console.log(response);
      value = response;

      s = '[';

      $.each(value, function(index, v) {
        s += '["' + v.title + '","' + v.start + '","' + v.end + '"],';
      });
      console.log(s);
      var d = s.slice(0, -1)
      d += ']';
      console.log(d);
      datavlue = JSON.parse(d);
      console.log(datavlue)
      $('#calendar').fullCalendar({
        // put your options and callbacks here
        left: 'Calendar',
        center: '',
        right: 'today prev,next',
        editable: true,
        events: [datavlue],
      })

    }
  });
});
about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

If you keep response as the value for events the calendar should work

$(document).ready(function() {
  var s = '';
  var value;
  var datavlue;
  
  var response = [{title: 'title2', start: '2021-09-10',end:'2021-09-10'}, {title: 'title2', start: '2021-09-10',end:'2021-09-10'}]
  
      $('#calendar').fullCalendar({
        // put your options and callbacks here
        left: 'Calendar',
        center: '',
        right: 'today prev,next',
        editable: true,
        events: response,
      })

    
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.29.1/moment.min.js"></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/fullcalendar/3.1.0/fullcalendar.js'></script>
<link rel='stylesheet' href="https://cdnjs.cloudflare.com/ajax/libs/fullcalendar/3.1.0/fullcalendar.min.css" />

<div id='calendar'></div>

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda