Prevent overlapping calendar events with same name/date


(John) #1

Matrix Version:

Hi gang,

I’m looking at making a simple item booking system using the calendar and an asset builder to create calendar events. To book an item the user must select one from a drop-down list and enter the start and end date, which creates a single calendar event.

As each ‘event’ is a booking, the tricky part will be preventing the user from double booking and creating one that already exists within the same date range with the same name.

Does anyone know how I could achieve this?

Cheers!


(Bart Banda) #2

You could maybe do a search for that date range before letting the user create the asset, and if the search returns any results, it means that that date range is unavailable? Could do it with ajax as well, so as soon as the user puts the start and end date/time in, do an ajax call to the calendar search page and if no results, then activate the create button with some JS.