How to make only one reservation at a specific time

How to make only one reservation at a specific time, Meaning, I do not want to place any reservation with another reservation so that the word more like the one in the screenshot does not appear

Attachment: screen_9e1a2e97.zip

1 Reply 1 reply marked as answer

BS Balasubramanian Sattanathan Syncfusion Team August 5, 2020 12:12 PM UTC

Hi Kareem, 

Greetings from Syncfusion Support. 

We have validated your requirement “How to make only one reservation at a specific time” at our side and prepared a sample based on that by making use of the actionBegin event and isSlotAvailable public method like the below code snippet. 

onActionBegin(args) { 
  if (args.requestType === 'eventCreate' && args.data.length > 0) { 
    let eventData = args.data[0]; 
    let eventField = this.scheduleObj.eventFields; 
    let startDate = eventData[eventField.startTime]; 
    let endDate = eventData[eventField.endTime]; 
    args.cancel = !this.scheduleObj.isSlotAvailable(startDate, endDate); 
  } 
} 


Kindly try the above solution and let us know if this is helpful. 

Regards, 
Balasubramanian S 


Marked as answer
Loader.
Up arrow icon