This is a migrated thread and some comments may be shown as answers.

How to check for double reservations/overlap (repeating events)?

1 Answer 155 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Gert
Top achievements
Rank 1
Gert asked on 29 Jul 2015, 12:15 PM

Dear Teleruik-Team,

Our Kendo Schedular is working very fine for booking cars and meeting rooms, but we have one big problem.It is possible to book the same car or room on the same moment and that cannot be possible. No overlaps may ​occur !
How can we check if a certain resource is already booked at a given day/time ? The biggest problem are the repeating events ! Because the contain a start date and a formula.

So what we need :

1) someone adds a reservation by clicking on a day

2) Schedular checks if resource is already reserved (also reperating events/reservations)

3) if ok, reservation is booked , else an errormessage is being displayed

How can wo do this ?

Regards,

Gert

 


 

1 Answer, 1 is accepted

Sort by
0
Gert
Top achievements
Rank 1
answered on 30 Jul 2015, 09:16 AM

Ok, found the solution :

 

save: function(e)
{                                 
            var scheduler = $("#scheduler").data("kendoScheduler");
            var events = scheduler.occurrencesInRange(e.event.start,e.event.end);
            if (events.length>1) //new event is included, that's why > 1
            {
                        alert('Overlap!!');
                        e.preventDefault();
                        return;
             }

Tags
Scheduler
Asked by
Gert
Top achievements
Rank 1
Answers by
Gert
Top achievements
Rank 1
Share this question
or