GetListItems - Recurring Events - DateRangesOverlap

Apr 19, 2011 at 9:53 PM

My Good Friend Marc (and the magnificent SPServices community):

I'm working with a jQuery library called FullCalendar, which has some pretty smooth jQuery functionality that the SP OOTB Calendar doesn't offer easily.

Good News: The great thing is that I can populate the FullCalendar using GetListItems on my Calendar list.

Bad News: The not-so-great thing is that most of my events are recurring, so just pulling the Start and End Dates gives me events that span several months, rather than recurring events that happen several times over several months.

Good News: Fortunately, the GetListItems web service allows me to pass some <QueryOptions> which will automatically expand a recurring event into multiple recurring events as independent nodes in the responseXML.

	$().SPServices({
	  operation: "GetListItems",
	  async: false,
	  listName: "My Calendar List",
	  CAMLViewFields: "<ViewFields>" +
	  		    "<FieldRef Name='Title' />" +
	  		    "<FieldRef Name='EventDate' />" +
	  		    "<FieldRef Name='EndDate' />" +
	  		    "<FieldRef Name='Location' />" +
	  		    "<FieldRef Name='Description' />" +
	  		    "<FieldRef Name='fRecurrence' />" +
	  		    "<FieldRef Name='RecurrenceData' />" +
	  		    "<FieldRef Name='fAllDayEvent' />" +
	  		"</ViewFields>",
	  CAMLQuery: '<Query>' +
			'<CalendarDate>' + start + '</CalendarDate>' +
			'<Where>' +
			    '<DateRangesOverlap>' +
				'<FieldRef Name="EventDate" />' +
				'<FieldRef Name="EndDate" />' +
				'<FieldRef Name="RecurrenceID" />' +
				'<Value Type="DateTime">' +
				    '<Year />' +
				'</Value>' +
			    '</DateRangesOverlap>' +
			'</Where>' +			'<OrderBy>' +
			    '<FieldRef Name="EventDate" />' +
			'</OrderBy>' +
		    '</Query>',
	  CAMLQueryOptions: '<QueryOptions>' +
				'<CalendarDate>' + start + '</CalendarDate>' +
				'<RecurrencePatternXMLVersion>v3</RecurrencePatternXMLVersion>' +
				'<ExpandRecurrence>TRUE</ExpandRecurrence>' +
			'</QueryOptions>',
	  completefunc: function (xData, Status) {
		var events = [];
//		  alert(xData.responseXML.xml);
		alert($(xData.responseXML).find("[nodeName=rs:data]").attr("ItemCount"));
		$(xData.responseXML).find("[nodeName=z:row]").each(function() {
		    var fADE = $(this).attr("ows_fAllDayEvent");
		    if (fADE != null) {
			if (fADE == 0) {thisADE = false}
			else thisADE = true;
		    }
		    var thisID = $(this).attr("ows_ID");
                      var sepID = thisID.indexOf(';#');
		    if (sepID != -1) thisID = thisID.substring(0,sepID);
		    var thisTitle = $(this).attr("ows_Title");
		    var thisRecurrence = $(this).attr("ows_fRecurrence");
		    var thisDesc = $(this).attr("ows_Description");								
								
                      if (thisID.length > 3) alert(thisTitle + ": " + thisID);
		    var thisUrl = "DispForm.aspx?ID=" + thisID + "&Source=FullCalendar.aspx";
		    var thisRD = $(this).attr("ows_RecurrenceData");						

events.push({ // className: ownerClass, \\Will be an @attrib in the responseXML title: thisTitle, start: $(this).attr("ows_EventDate"), end: $(this).attr("ows_EndDate"), allDay: thisADE, url: thisUrl, description: thisDesc }); });

This returns a nice dataset of recurring events, exploded out into the individual iterations that occur during the the given timeframe.

Sort of.

The "given timeframe" is <Year />, which is supposed to mean... all of the events that occur in the same calendar year as the given date.

The "given date," according to several blogs, can be set by adding the CalendarDate node of the query.

My question:

When I use SPServices to grab events in this way, I get the following results:

<Year />: All events that occur this today or later (not just one year's worth)

<Month />: All events that occur within the "month view" of the current month (overlapping by a full or partial week on both ends; e.g. April 2011 results in dates from March 28 through May 2)

<Week />: Only the events that occur during this week.

<Today />: Only the events that occur today.

<Now />: Same as <Year />

And it doesn't seem to matter if I pass <CalendarDate> as a node in the <Query>, or as a node in the <QueryOptions>, or as a replacement for <Year />, or inside the <Year> node. None of these seems to have an affect.

So, Marc... do you know? If it's supposed to be in the Query node, will SPServices handle that correctly? Or is it supposed work as is, but is broken on the web service side?

Apr 20, 2011 at 1:10 PM

Wow! That is some cool code there and it seems like it should do what you want. I would recommend cleaning up the jQuery in case you upgrade to 1.5 or greater as I see that you are not single quoting some selectors (rs:data and z:row for example). I am sure that is not the issue but just an FYI. I actually was wondering if your "start" variable is set properly and what it is actually set to. This is pretty cool so far!

Apr 20, 2011 at 1:35 PM

Update: <CalendarDate> must be passed as a node in the <QueryOptions> (unless Marc has makes provisions for it as calendarDate: at some point). Also, it must be in T-Z format (i.e. 2011-04-20T00:00:00Z)

Now, given those caveats, <Month /> will return the "month view" of dates, properly exploded for the month that the given date falls "fully" in.

IOW, March 28, 2011 is the starting boundary for the April 2011 view. If you set calendarDate to 2011-03-28T00:00:00Z, however, you will get the March 2011 view.

Daniel, to answer your question, the "start" variable is calculated by the FullCalendar (www.arshaw.com/fullcalendar/) library, as the left boundary of the month view. So, for April 2011, start is March 28, 2011.

Caveat: Year still gives from "Today" forward.

Coordinator
Apr 20, 2011 at 2:56 PM

This is very interesting. Marc's on vacation, but I know he'll look at this when he comes back. I'm not sure there are provisions for calendarDate in SPServices, but I may be wrong (Marc's the one that's obviously the most intimate with that stuff).

It's always cool to see SPServices being integrated with other plugins for new uses!

Coordinator
Apr 21, 2011 at 9:42 PM
For the record, I don't do anything with the values you pass into GetListItems. You're talking to the Web Service directly.

Is there a useful abstraction here for SPServices?

M.
>
Apr 22, 2011 at 6:13 PM

Yes, I think there's a useful abstraction... Let me write up the blog post and then we can talk about how to make it a SPService feature. Incredible stuff... hard to find any doco online. ;)

 

Blessings,
Jim Bob

Coordinator
Apr 27, 2011 at 3:15 PM

Wow. How did you discover this, Jim Bob? There's certainly zippo in the SDK about these parameters for GetListItems.

M.

Jun 6, 2011 at 1:23 PM

I switched to "Month" because this offers the best results.  However I cannot get the start variable to populate.  There must be something in FullCalendar that refetches when the monthview changes, but I do not know how to wire it up to SPServices(). 

Jun 6, 2011 at 1:33 PM

zedekiah, what've you tried? Perhaps we can help you tweak it a bit.

Blessings,

Jim Bob

Jun 6, 2011 at 2:46 PM
Edited Jun 6, 2011 at 2:50 PM

 

I got everything to work except the populating of the calendar.  I discovered how to connect start right here:

http://arshaw.com/fullcalendar/docs/event_data/events_function/

In your code example, and btw, I consider it an honor that you responded, how is

var events = [];

bound to the calendar?

Jun 6, 2011 at 3:36 PM

It works within the call declaration of the events node of the fullCalendar call...

$('#calendar').fullCalendar({
  .
  .
  .
  events: function(start, end, callback) {
   $().SPServices({
     operation: "GetListItems",
     async: false,
     listName: listName,
     CAMLViewFields: CAMLFields,
     CAMLQuery: query,
     CAMLQueryOptions: '' +
       '' + startDate + '' +
                'v3' +
         'TRUE' +
        '',
    completefunc: function (xData, Status) {
      var events = [];
      $(xData.responseXML).find("[nodeName='z:row']").each(function() {
       var fADE = $(this).attr("ows_fAllDayEvent");
       if (fADE != null) {
        if (fADE == 0) {thisADE = false}
        else thisADE = true;
       }
       var thisID = $(this).attr("ows_ID");
       var sepID = thisID.indexOf(';#');
       if (sepID != -1) thisID = thisID.substring(0,sepID);
       var thisTitle = $(this).attr("ows_Title");
       var thisRecurrence = $(this).attr("ows_fRecurrence");
       var thisDesc = $(this).attr("ows_Description"); 
       var thisTextColor = '#fff';
       if(thisBGColor == undefined) {
        thisBGColor = "#36c";
       } else {
        var thisRGBColor = new RGBColor(thisBGColor);
        if (thisRGBColor.g > h2d('99')) {
         thisTextColor = '#000';
        }
       }
       var thisRD = $(this).attr("ows_RecurrenceData");        
       events.push({
        className: thisClass,
        title: thisTitle,
        start: $(this).attr("ows_EventDate"),
        end: $(this).attr("ows_EndDate"),
        allDay: thisADE,
        url: thisUrl,
        description: $(thisDesc).text(),
        BGColor: thisBGColor,
        txtColor: thisTextColor
       });
      });
      
      callback(events);
    }
   });
  },
  .
  .
  .
})

Does that help?

Blessings,
Jim Bob

Jun 6, 2011 at 3:46 PM

You alone are the holy one.  Thanks a lot.  It was the missing. Piece.  I wish I could help in some way.

Jun 6, 2011 at 4:30 PM

LOL! You have me confused with my King.

Glad I could help, though.

Blessings,
Jim Bob
Prov. 3:5-6

Jun 23, 2011 at 12:56 AM

Thanks in advance for those who have posted sample code.  I'm trying to do something close to this and I can't seem to figure out what "stupid" thing I'm doing.  In general what I want to do is to pull events from a Sharepoint calendar list and display them in a pre-formatted web page.  I'm have code that works to pull events off of a different calendar list, but I can't figure out how to det recurring events out.  I have compared my code to what you have shared, but I can't figure out what I'm missing.  I can't seem to get any results back.

I have just been learning this by looking at other's code and adapting to what I need, so I know I missing something simple that I can do to figure this out ...  I just need pointed in a direction.

Any help would be greatly appreciated.

Jennifer

  var aDate = "2011-06-01T00:00:00Z"
  var i = 0;
  var strQuery = "<Query><CalendarDate>" + aDate + "</CalendarDate>";
  
 strQuery = strQuery + "<Where>"
  + "<DateRangesOverlap>"
  + "<FieldRef Name='EventDate' />"
  + "<FieldRef Name='EndDate' />"
  + "<FieldRef Name='RecurrenceID' />"
  + "<Value Type='DateTime'>"
   + "<Month />"
  + "</Value>"
  + "</DateRangesOverlap>"
  + "</Where>"
  + "<OrderBy>"
   +  "<FieldRef Name='EventDate' />"
  + "</OrderBy>"
  
 strQuery = strQuery + "</Query>"
 alert (strQuery);
  
  $().SPServices({
    operation: "GetListItems",
    async: false,
    listName: parmListName,
    CAMLViewFields: "<ViewFields>"
     + "<FieldRef Name='Title'/>"
     + "<FieldRef Name='ID' />"
     + "<FieldRef Name='Description' />"
     + "<FieldRef Name='Body' />"
     + "<FieldRef Name='Expires' />"
     + "<FieldRef Name='URL' />"
     + "<FieldRef Name='Created' />"
     + "<FieldRef Name='Category' />"
   + "<FieldRef Name='EventDate' />"
   + "<FieldRef Name='EndDate' />"
   + "<FieldRef Name='fAllDayEvent' />"
   + "<FieldRef Name='RecurrenceID' />"
  + "<FieldRef Name='fRecurrence' />"
  + "<FieldRef Name='RecurrenceData' />"
  + "</ViewFields>",
    CAMLQuery: strQuery,
   CAMLQueryOptions: "<QueryOptions>"
      +  "<CalendarDate>" + aDate + "</CalendarDate>"
      +  "<RecurrencePatternXMLVersion>v3</RecurrencePatternXMLVersion>"
      + "<ExpandRecurrence>TRUE</ExpandRecurrence>"
      + "</QueryOptions>",
    CAMLRowLimit: 0,
    debug: true,
    completefunc: function (xData, Status) {
    
    alert($(xData.responseXML).find("[nodeName='rs:data']").attr("ItemCount"));

      $(xData.responseXML).find("[nodeName='z:row']").each(function() {

  var fADE = $(this).attr("ows_fAllDayEvent");
  if (fADE != null) {
   if (fADE == 0) {thisADE = false}
   else thisADE = true;
  }
  
  var thisID = $(this).attr("ows_ID");
  var sepID = thisID.indexOf(';#');
  
  var sepID = thisID.indexOf(';#');
        if (sepID != -1) thisID = thisID.substring(0,sepID);
      
        var thisTitle = $(this).attr("ows_Title");
        var thisRecurrence = $(this).attr("ows_fRecurrence");
        var thisDesc = $(this).attr("ows_Description");
 
  
         alert (thisID + " : " + thisTitle + " : " + $(this).attr("ows_EventDate") + "-" + $(this).attr("ows_EndDate"));
        .....

        i = i+1;
      }); //END EACH
    }  //END COMPLETEFUNC
  });  //END SPSERVICES

Jun 23, 2011 at 5:36 PM
One thing I noticed is that you're missing a semi-colon after your declaration of aDate:
var aDate = "2011-06-01T00:00:00Z";
I think that may be messing up your CAMLQueryOptions. (I may be wrong, but if you built the CAMLQueryOptions as a variable that you then used in the SPServices call, I'd be interested to see what you get in an alert for that variable.
Let me know if that fixes it. If not, I'll mock up a page and see if I can walk through it to see where you're having issues.
Blessings,
Jim Bob
Jun 23, 2011 at 9:38 PM

Jim Bob,

Thanks .. that did get me closer.  I'm at least finding events now.  The results are now just returning the event as defined.  For example, I have an event that occurs every day, I only get one back.  I expected to get one for every day within the month parameter.  Is that reasonable to expect?

Thanks so much for taking the time and pointing out my blunder!!

Jennifer

Jun 24, 2011 at 2:12 PM
Edited Jun 24, 2011 at 6:59 PM
Jennfer,
Looking at your code, all looks right, except for the CAMLRowCount, and that CalendarDate should only be the in the QueryOptions, not the Query, too... But, if you're only getting the date entry without the recurrence exploded... it sounds like it's not picking up your QueryOptions.
I've put your code (with a couple of tweaks) into the formatter here to see if it helps anything jump out. Give it a try and let me know how it works for you.
var aDate = "2011-06-01T00:00:00Z";
var i = 0;
// var strQuery = "<Query><CalendarDate>" + aDate + "</CalendarDate>";
  
var strQuery = "<Query><Where>" +
            "<DateRangesOverlap>" +
                "<FieldRef Name='EventDate' />" +
                "<FieldRef Name='EndDate' />" +
                "<FieldRef Name='RecurrenceID' />" + 
                "<Value Type='DateTime'>" +
                    "<Month />" +
                "</Value>" +
            "</DateRangesOverlap>" +
        "</Where>" +
        "<OrderBy>" +
            "<FieldRef Name='EventDate' />" +
        "</OrderBy>" +
    "</Query>";
  
var strOptions = "<QueryOptions>" + 
        "<CalendarDate>" + aDate + "</CalendarDate>" +
        "<RecurrencePatternXMLVersion>v3</RecurrencePatternXMLVersion>" +
        "<ExpandRecurrence>TRUE</ExpandRecurrence>" +
    "</QueryOptions>";

$().SPServices({
    operation: "GetListItems",
    async: false,
    listName: parmListName,
    CAMLViewFields: "<ViewFields>" +
            "<FieldRef Name='Title'/>" +
            "<FieldRef Name='ID' />" +
            "<FieldRef Name='Description' />" +
            "<FieldRef Name='Body' />" +
            "<FieldRef Name='Expires' />" +
            "<FieldRef Name='URL' />" +
            "<FieldRef Name='Created' />" +
            "<FieldRef Name='Category' />" +
            "<FieldRef Name='EventDate' />" +
            "<FieldRef Name='EndDate' />" +
            "<FieldRef Name='fAllDayEvent' />" +
            "<FieldRef Name='RecurrenceID' />" +
            "<FieldRef Name='fRecurrence' />" +
            "<FieldRef Name='RecurrenceData' />" +
        "</ViewFields>",
    CAMLQuery: strQuery,
    CAMLQueryOptions: strOptions,
//        CAMLRowLimit: 0,
    debug: true,
    completefunc: function (xData, Status) {
        alert($(xData.responseXML).find("[nodeName='rs:data']").attr("ItemCount"));
        $(xData.responseXML).find("[nodeName='z:row']").each(function() {
            var fADE = $(this).attr("ows_fAllDayEvent");
            if (fADE != null) {
                if (fADE == 0) {thisADE = false}
                else thisADE = true;
            }

            var thisID = $(this).attr("ows_ID");
            var sepID = thisID.indexOf(';#');
      
            var sepID = thisID.indexOf(';#');
            if (sepID != -1) thisID = thisID.substring(0,sepID);
           
            var thisTitle = $(this).attr("ows_Title");
            var thisRecurrence = $(this).attr("ows_fRecurrence");
            var thisDesc = $(this).attr("ows_Description"); 
      
            alert (thisID + " : " + thisTitle + " : " + $(this).attr("ows_EventDate") + "-" + $(this).attr("ows_EndDate"));
            .....

            i++;
        }); //END EACH
    }  //END COMPLETEFUNC
});  //END SPSERVICES
Blessings, Jim Bob
Jun 24, 2011 at 8:37 PM

Hi Bob,

I am also facing the same issue that Jennifer is observing.

I used the above code, and made the changes to pass the appropriate list name, but in the results I am not getting recurring events expanded.Recurring event is also getting returned as single event.

Any thoughts on what else I need to check to make sure the query works to return the recurring instances.

Thanks In Advance,

Padmaja

 

Jun 24, 2011 at 9:01 PM
Edited Jun 24, 2011 at 9:01 PM
I confess, it's been a bit of time since I worked on this, so here's is how I have it documented in my code which is working in production. Hopefully, this will provide some insight for some of you as you work to troubleshoot:
// Major silliness going on here, thanks to the way M$ does recurring events.
//
// start = the first day of the current "month view" (i.e. the "the month view" for April 2011
//         begins on March 28, 2011, because April 1 is on a Friday and the "month view" displays
//           full weeks.)
// end   = the last day of the current "month view" (for April 2011, it's May 2, 2011)
//
// In the CAML, we have to pass the QueryOptions to get all Recurring Events to be returned as individual
// instance nodes, including those in an "older" [e.g. v3] format. (Yes, in SharePoint, *some* [not all,
// mind you] of the events you create will actually be in the v3 format.) We also need the RecurrenceData
// and fRecurrence fields returned in order to get everything we need.
//
// The WHERE clause in the query is also a piece of work. And cryptically-documented, where mentioned at
// all. The basics are that you can return dates that "overlap" a given scenario. The overlapping varies
// depending on scenario, as follows:
//    <Year />: This is *supposed to* get all events within (a) today's year, or (b) the date passed in
//              QueryOptions as CalendarDate.
//              Actual: It returns all dates from Today into the future.
//                      It ignores (a) the CalendarDate, and (b) the end of the current year.
//   <Month />: Performs consistently as expected, with the exception that its definition of "month"
//              coincides with the "month view" explanation above.
//              Caveat: March 28 is the beginning of the April month view, but when passed as the
//                      CalendarDate, it will return the March month view.
//                      ...which is the reason for the date calculations below.
//    <Week />: Performs exactly like <Month />, but only returns the corresponding week for (a) Today
//              or (b) CalendarDate.
//   <Today />: Returns just the events for Today.
//     <Now />: Contrary to most documentation, <Now /> doesn't "work" but rather defaults to the same
//              results as <Year />.
// In fact, <Year /> is the default. If you leave off the entire WHERE clause, but include the RecurrenceDate
// and fRecurrence fields and the QueryOptions (CalendarDate will be ignored), you get the same results as
// <Year />.
//
// All of that to explain the reason for the calculations below.

// CalendarDate needs the date to be a string in the format:
//      yyyy-mm-ddThh:mm:ssZ
startDate = start.getYear() + '-'; // returns the year as YYYY
monthAdj = 1; dayAdj = 0;
// Since start is the beginning of the month view, it will either be the 1st or within the last week of the
// previous month. Therefore, if it's over 10, we know our view is starting in the previous month: we'll add
// an extra month to our calculations, and subtract 10 days. So, if start is 3/28, we'll make it 4/18 to make
// sure it's fully in the month we want to view.
if(start.getDate()*1 > 10) { monthAdj++; dayAdj = -10 };
// getMonth returns the zero-based number of the month with no leading zeroes, so we'll add 1 at least, but
// will add 2 if our view starts the previous month. And if it's < 10, we'll add a leading '0' to the string.
if((start.getMonth()*1+monthAdj) < 10) {startDate += "0";}
startDate += (start.getMonth()*1+monthAdj) + '-';
// getDate returns the number of the day with no leading zeroes, so if it's < 10 we'll add a leading '0'
if (start.getDate()*1 < 10) {startDate += "0";}
// For good measure we'll set the time at noon to ensure we're fully into the day we're basing things on
startDate += (start.getDate()*1+dayAdj) + "T12:00:00Z";

$().SPServices({
    operation: "GetListItems",
    async: false,
    listName: "Team Calendar",
    CAMLViewFields: "<ViewFields>" +
            "<FieldRef Name='Title' />" +
            "<FieldRef Name='EventDate' />" +
            "<FieldRef Name='EndDate' />" +
            "<FieldRef Name='Location' />" +
            "<FieldRef Name='Description' />" +
            "<FieldRef Name='fRecurrence' />" +
            "<FieldRef Name='RecurrenceData' />" +
            "<FieldRef Name='fAllDayEvent' />" +
        "</ViewFields>",
    CAMLQuery: '<Query>' +
            '<Where>' +
                '<DateRangesOverlap>' +
                    '<FieldRef Name="EventDate" />' +
                    '<FieldRef Name="EndDate" />' +
                    '<FieldRef Name="RecurrenceID" />' +
                    '<Value Type="DateTime">' +
                        '<Month />' +
                    '</Value>' +
                '</DateRangesOverlap>' +
            '</Where>' +
            '<OrderBy>' +
                '<FieldRef Name="EventDate" />' +
            '</OrderBy>' +
        '</Query>',
    CAMLQueryOptions: '<QueryOptions>' +
            '<CalendarDate>' + startDate + '</CalendarDate>' +
            '<RecurrencePatternXMLVersion>v3</RecurrencePatternXMLVersion>' +
            '<ExpandRecurrence>TRUE</ExpandRecurrence>' +
        '</QueryOptions>',
    completefunc: function (xData, Status) {
        alert(xData.responseXML.xml);
    }
});

Blessings,
Jim Bob
Jun 24, 2011 at 9:41 PM

Hi Bob,

Many thanks for quick response.

One query I have is what should be the format that should be passed in for start variable.

I have tried with the below value for start , and did not get recurrence expanded.

start = new Date();

I suspect is there something to do with that?

Thanks,

Padmaja

Jun 24, 2011 at 9:45 PM

Yes, Padmaja. It must be in the ISO format:

// CalendarDate needs the date to be a string in the format:
//      yyyy-mm-ddThh:mm:ssZ

Which is why I build it out that way in my code.

Blessings,
Jim Bob

Jun 24, 2011 at 10:20 PM

Hi Bob,

When I see the date that is passed in for the startDate after the calculations in my case as 2011-07-01T12:00:00Z, I believe it is in the format that you mentioned.

On my calendar I have 4 instances of a recurring event which spans in this time peroid of 1 month from 2011-06-01 to 2011-07-01. But I could not get that pulled by this code.

I have to figure it out why recurring events are not expanded in my case.

Many thanks,

Padmaja

Jun 24, 2011 at 10:50 PM

Jim Bob,

I can't thank you or repay you enough for helping me.  I'm still stuck .. the query and query options look good (as best I can tell) before I call spServices.  I'm using spServices 0.6.1 and jQuery 1.4.4

I have tried the query in CAML Builder to see if it was my jQuery code .. it also just returns 3 records for me ... I don't know if CAML Builder understand query options enough to explode it out .. but it didn't balk at me either.

If I look at my Calendar in SharePoint .. I can see each recurring event on the calendar, so I think I have them defined correctly in the list.

Is there some debug or other utility that I could put the query in just to figure out if it is my code, query ... ?  I just know this is something really stupid I have done.

Thanks again,

Jennifer

Jun 25, 2011 at 3:38 PM

Hi Bob & Jennifer,

I too stuck with this. I was using the same Bob's code posted latest in this thread, but no luck in getting the recurrence events.

I found the below link, but I still have to check whether my server has that patch installed or not as I do not have access to my server at this point.

http://blogs.msdn.com/b/navdeepm/archive/2010/03/11/how-to-query-lists-asmx-to-get-the-recurring-events.aspx

Thanks,

Padmaja

 

Jun 27, 2011 at 4:53 PM

I haven't had a chance to dig into this too deeply, but I'd like to refer you to Marc's blog post today: http://wp.me/ppule-3B9, where he discusses backward compatibility with SPServices and jQuery versions. If you have your code exactly like mine and only one of us is working, it's most likely a version compatibility issue.

Hope that points you in the right direction.

Blessings,
Jim Bob

Jun 29, 2011 at 8:00 PM

Hi Bob,

Here is what the versions that I have:

jQuery: v1.4.2

SpServices: Version 0.5.7

Thanks,

Padmaja

Jun 29, 2011 at 8:11 PM

I have it working with:

jQuery 1.4.2 and SPServices 0.5.8 :)

Blessings,
Jim Bob

Aug 14, 2012 at 4:52 AM

I had to apply the hot fix before web services would recognize the CalendarDate Query Option.

http://support.microsoft.com/kb/974087

1) Click on the Download hotfix link from the link off the resolution KB, and you will be emailed a link to the hot fix for either x86 or x64.

 2) You run the hot fix after extracting it, and its a simple install.  Reboot IS required.

3) You MUST run the Start -> Programs -> Microsoft Office Server ->  Sharepoint Products and Technology Configuration Wizard after the install.  It makes some database changes and the binaries to work with the changes must be applied to all servers in the farm.

4) After that, WSS3.0 and MOSS 2007 Web Services will accept the CalendarDate Query Option.

Oct 4, 2012 at 5:49 PM

Interesting... the recurrence expansion doesn't work unless your view fields include fRecurrence. Wacky!

May 16, 2013 at 9:43 PM
Edited May 16, 2013 at 9:44 PM
Not to necro this, but I wanted to add something to the thread as it may help others. I too was having issues with recurring events not display correctly on my FullCalendar until I changed
'<Value Type="DateTime">' +
                        '<Month />' +
                    '</Value>' +
with
'<Value Type="DateTime">' +
                        '<Year />' +
                    '</Value>' +
Only then did my recurring events get expanded on show on the calendar. ANd looking at Jim Bob's initial post, he has Year and not Month which we all might have just been glossing over.
Jun 10, 2014 at 2:44 PM
HI every one. This post really helped me out ey.
I have a few or one problem.

on callback(events) I get an error, Uncaught TypeError: boolean is not a function
Been cracking my head here please help not still new here. ohh and I am using sharepoint 2013.

let me just post my code for control.
$('#calendar').fullCalendar({
                    
                       editable: true,
                      events: function(start, end, callback) 
                      {
                       $().SPServices(
                       {
                          operation: "GetListItems",
                          async: false,
                         webURL:"http://mydomain.ac.za/",
                         listName: "mylist",
                         CAMLViewFields: "<ViewFields><FieldRef Name='ID' /><FieldRef Name='Title' /><FieldRef Name='Start_x0020_Date' /><FieldRef Name='End_x0020_Date' /></ViewFields>",
                        completefunc: function (xData, Status) 
                        {
                          var events = [];alert(xData.responseText); // alert just to see the data that has been returned. 
                          $(xData.responseXML).find("z\\:row").each(function() 
                          {
                         
                           var thisID = $(this).attr("ows_ID");
                           var thisTitle = $(this).attr("ows_Title");
                           var thisStartDate = $(this).attr("ows_Start_x0020_Date");
                           var thisEndDate = $(this).attr("ows_End_x0020_Date"); ;
                           var thisTextColor = '#fff';
                           var thisBGColor = '#36c';
    
                           events.push(
                           {
                            title: thisTitle,
                            start: thisStartDate,
                            end: thisEndDate
                           });
                          });
                          
                          callback(events);
                        }
                       });
                      }
                    }); 
Thank you for the help in advance. you Guys Rock!!!
Nov 5, 2014 at 7:42 PM
Edited Jan 21, 2015 at 2:02 PM
FerbDee -

Edit: Actual fix:
In FullCalendar code above -> events: function(start, end, callback)

apparently now you have to use -> events: function(start, end, timezone, callback)
Jan 29, 2015 at 1:51 PM
Good article, it works as stated
Nov 6, 2015 at 12:39 PM
Hello together!

i´m very very new at sharepoint/jQuery and i´ve got to solve a problem. For that i need a function that tells me just if there is an spezific entry in a calender in a spezific line.
I dont realy know how to start or to manipulate the code to do so. I would be very pleased if yu could help me, give me some intentions how i can solve that problem!!

Thanks so far
Max