A lightweight SharePoint JavaScript library to easily manage calendar events.
Easily retrieve recurring events from a SharePoint calendar, without the need to set up a CAML query.
Built in methods help to filter events that match user defined search criteria.
Just define the data you want to retrieve, then use a callback function to filter the results.
spcalpro.getCalendarEvents({
listName: "StaffSchedule"
}).ready(function(data, obj) {
if (obj.error) console.error(obj.error);
console.table(data);
});
These methods are the real hero of this library- define how SharePoint calendar and list data are collected.
Helpful functions that facilitate how users define the datetimes to be referenced when filtering.
Calendar events can be filtered based on provided dates, date ranges, or from user forms.
The code below will:
StaffSchedule
calendar list, which is located at the /SiteColl/CalendarSubSite
subsite.0,1
parameters specify which datetime field elements on a form are to be converted.spcalpro.getCalendarEvents({
listName: "StaffSchedule",
fields: ["Status", "Profession", "Address"],
where: "Title = Homer Simpson",
sourceSite: "/SiteColl/CalendarSubSite"
}).ready(function(data, obj) {
if (obj.error) console.error( obj.error );
var homerJSimpson = obj.isTimeConflict("2019-03-01 00:00:00", "2019-04-01 00:00:00");
console.table( homerJSimpson );
});
<script src="/path/js/spcalendarpro.js"></script>
to get started.