Giter VIP home page Giter VIP logo

spcalendarpro's Introduction

SPCalendarPro

An ultra lightweight, dependency-free JavaScript library to easily manage SharePoint calendar events.

The painful process of obtaining recurring events, matching user provided datetimes with events, and determining time conflicts is tortorous and requires multiple dependencies and lots of code. SP Calendar Pro simplifies this process enormously.

Syntax

spcalpro.getCalendarEvents({
    listName: "StaffSchedule"
}).ready(function(data, obj) {
    if (obj.error) console.error( obj.error );
    console.table( data );
});

Features

  1. Easily collects recurring calendar events.
  2. Provides a simple way to collect requested datetime values the user.
  3. Provides several methods to easily facilitate various datetime comparisons. Match specified datetimes: matchDateTimes(), determine time conflicts: isTimeConflict(), same dates: isSameDate(), etc).
  4. A basic 'where' property to filter down the returned data in the CAML query.
  5. Returns regular list items along with calendar events.
  6. Option to disable calendar drag and drop: spcalpro.disableDragAndDrop()
  7. Requires zero dependencies! Everything is pure vanilla JS.
  8. Compatible for all SharePoint versions- 2010, 2013, 2016, 2019, and SP Online.
  9. Lightweight! 6 KB minified, 15 KB unminified, with comments.

Example

The code below will:

  1. Asynchronously collect all events (single and recurring) from the StaffSchedule calendar list.
  2. Return only the events have a Title of Homer Simpson.
  3. Compare the returned calendar events to see if any pose a time conflict with the datetimes provided in the .isTimeConflict() parameters.

spcalpro.getCalendarEvents({
    listName: "StaffSchedule",
    async: true,
    where: "Title = Homer Simpson"
}).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 );
});

Full documentation can be found here: https://sphacks.io/sp-calendar-pro

spcalendarpro's People

Contributors

samperrow avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

spcalendarpro's Issues

Extracting data from different site collection

Thanks for this solution! I've been searching for something like this for at least a year. Question, how do I configure it to extract data from a calendar in a different site collection?

Return Author

Would it be possible to return who created the event?

Fields being ignored

When specifying fields, they just seem to be ignored. For example below

var data = {
    listName: "Primary Bookings",
    fields: ["EventDate", "EndDate"," Title"]
}

spcalpro.getCalendarEvents(data).ready(function(data, obj) { 
    if (obj.error) console.error(obj.error);                        
    console.table(data);
});

Filtering doesn't bring back recurring events

I know you mentioned that you no longer do SP dev but was hoping maybe someone else was able to fix this problem I am having. If I use a filter it will only bring back the single event and not the recurring events for it.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.