the Forum

Load data every month using Jquery FullCalendar and Expression Engine

Posted on October 13, 2011 by Michael Rosario
Total Posts: 33  |  Join date: 03-12-11

The Jquery FullCalendar allows you to provide 'eventsources' with all the events to a Calendar. However, when you have more than 300+ events, loading the calendar becomes really slow and inefficient. The solution is to load all the events or that month only on load and on click of prev/next. After reviewing and analyzing the FullCalendar plugin, we find out that the Calendar adds the following query string to the end of the source:
/events_feed/?start=1316923200&end=1320552000&_=1318533086181 
These represent the start and end of each month display. On the events_feed template. I have the following PHP (parsed during INPUT) to get these values:
<?php
  $start 
=  $_GET['start']
  
$end =  $_GET['end']
  
$starton date('Y-m-d H:i',$start);
  
$endon date('Y-m-d H:i',$end);
?> 
I then feed these values to the following expression engine parameters:
{exp:channel:entries start_on="<? echo $starton; ?>" stop_before="<? echo $endon; ?>"}...YOUR CODE...{/exp:channel:entries} 

Tags: There are no tags for this entry.

2 answers, add yours below

Posted on on December 3, 2011 at 12:04am
by Asics Onitsuka

Really awesome. This is more efficient. I used to load 300+ events per load, now it only loads events within the dates 80-90 events. Thanks!

 

Posted on on June 3, 2012 at 10:41pm
by wonk4rol

Thanx a lot, i have same problem like this. my full calendar don't show all events in my DB.

 
add your answers here
comments powered by Disqus