Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

332
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!