Is there a way to programmatically check a booking if already exist in sharepoint calendar?

I am saving recurring entries programmatically using the xml rule for recurrence as per this, for recurring entries I want to check if any entry exist for the same date time.

If I do ExpandRecurrence and fetch all the entries within the start and end date of the current event than how will I check if the current item I want to save will fall within that range?

Kindly explain how to go about the same.

1 Answer 1


With JavaScript and jQuery you can query your calendar for conflicting events Events and Possible Overlap Situations

Based on this image, the 'Event' needs a query that finds Events A,B,E and F (C and D don't Overlap 'Event')

  • Start of Other Events are with the Start and End of this Event
  • End of Other Events are with the Start and End of this Event
  • Start of Other Events is less the Start of this Event and End of Other Events is greater then the End of this Event

To the code:

sd = CurrentEventStart.toISOString(), ed = CurrentEventEnd.toISOString();

Start Dates With-in: (note use of sd and ed)


End Dates With-in: (note use of sd and ed)


Overlapping Events: (Starts prior and Ends after) 'Event B' in image


Last you will want to exclude the current event (if it is an edit form):


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.