2 years ago

#71222

test-img

macca4244

Uncaught TypeError: Cannot read properties of undefined (reading 'hasTime') in fullcalendar when pulling through large number of SQL records

As the title says, I am getting that uncaught TypeError when I pull through for example 1800 records on the SQL statement to populate the calendar. If I add a LIMIT clause to the statement (to around 1500) records, it will pull through ok and display.

I could use this as a solution as a last resort basis, but ideally I would like to pull through all of the records. I did some research and found this question Uncaught TypeError: Cannot read properties of undefined (reading 'hasTime') in fullcalendar which I believe is on the right lines, however I'm not too sure how to add my events as a javascript response variable, as I am currently accessing events using a URL which json encodes the data. Any help would be appreciated. See below for my calendar initialisation

$(document).ready(function() {
var calendar = $('#calendar').fullCalendar({
editable:true,  
header:{
  left:'prev,next today',
  center:'title',
  right:'month,agendaWeek',
},
droppable: true, 
events: 'deliveryCalendars/deliverySheduleLoad.php',

Then my code to put the data into an array

$deliveryDateArray[] = array(
    'mainID'  => $row["orderID"],
    'id'   => $row["DeliveryID"],
    'title'   => $row["lastName"],
    'start'   => $row["deliveryDate"],
    'color' => $color,
    'materials' => $insulation
);
echo json_encode($deliveryDateArray, JSON_PRETTY_PRINT);

javascript

php

json

fullcalendar

fullcalendar-3

0 Answers

Your Answer

Accepted video resources