We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Non overlap events

Thread ID:

Created:

Updated:

Platform:

Replies:

142905 Feb 25,2019 03:54 PM UTC Sep 10,2019 06:07 AM UTC React - EJ 2 5
loading
Tags: Schedule
aaa
Asked On February 25, 2019 03:54 PM UTC

I'm using "Date-wise Grouping" like  schedule

 <ScheduleComponent height='650px' className={classes.calendar}
showHeaderBar = {true}
resourceHeaderTemplate= { this.resourceHeaderTemplate }
dateHeaderTemplate= { this.dateHeaderTemplate }
eventRendered={this.eventRendered}
actionComplete={this.actionComplete}
eventSettings={{ dataSource: events }}
group={{ byDate: true, allowGroupEdit: true, resources: ['Owners'] }} >
<ResourcesDirective>
<ResourceDirective field='resourceIds' title='Assignee' name='Owners' allowMultiple={true} dataSource={users} textField='name' idField='id' colorField='color'>
</ResourceDirective>
</ResourcesDirective>

And I need to events be unique, so one User cannot  have 2 events at same time.

I  multiple all my events to  block and event itself:
_.flatten( this.visits.map(x=> { return [
{ IsBlock:true, StartTime: x.start, EndTime: x.end, resourceIds: x.techs.map(t=> t.user_id) },
{ Id: x.id, StartTime: x.start, EndTime: x.end, resourceIds: x.techs.map(t=> t.user_id), IsReadonly: false } ] }) )

It works fine  for new events,  but its also prevent to save existing event, even if I not change times.
Is it any other  way  to achieve  same functionality?

Karthigeyan Krishnamurthi [Syncfusion]
Replied On February 26, 2019 11:20 AM UTC

Dear Customer, 
   
Thank you for contacting Syncfusion support. 
   
 
Your requirement can be achieved using isSlotAvailable method, kindly refer the below UG link. 
 
 
 
Regards, 
Karthigeyan 


Tshepo
Replied On April 19, 2019 08:21 PM UTC

Hi there,

I also have the same problem, i want my time slots to only allow 1 event (booking) at a time.
I followed the documentation on isSlotAvailable and it does not work with both javascript and typescript.
I also tried using the isSlotAvailable documentation example with your demos but i can't get it to work on any setup including trying to use it on your stackblitz.com demos setup.

All help will be very much appreciated.

Thanks

Nevitha Ravi [Syncfusion]
Replied On April 22, 2019 10:36 AM UTC

Hi Tshepo, 

Greetings from Syncfusion Support. 

We have prepared a stackblitz sample to prevent appointment creation and updating if the time slot is already booked for your reference which can be viewed from the following link. 

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]; 
      let groupIndex = eventData.ConferenceId[0] - 1; 
      args.cancel = !this.scheduleObj.isSlotAvailable(startDate, endDate, groupIndex); 
    } 
  } 

Please check the sample and let us know if you need any further assistance. 

Regards, 
Nevitha 


Sudhanshu Jain
Replied On September 9, 2019 10:18 AM UTC

Hi Syncfusion,

I have same problem .I have tried isSlotAvailable method in all way .But it is not working as expected .I have tried above method also .It is also not working.Can you please let us how can we restrict that.

Karthigeyan Krishnamurthi [Syncfusion]
Replied On September 10, 2019 06:07 AM UTC

 
Syncfusion greetings. 
 
We have checked the isSlotAvailable method and it is working correctly. Kindly try the sample and if the issue persists, try to reproduce the error in a sample and revert else share your code example/runnable sample (if possible) to serve you better. 
 
onActionBegin(args) { 
    if (args.requestType === 'eventCreate' || args.requestType === 'eventChange') { 
      let data; 
      if (args.requestType === 'eventCreate') { 
        data = args.data[0]; 
      } 
      else if (args.requestType === 'eventChange') { 
        data = args.data; 
      } 
      if (!this.scheduleObj.isSlotAvailable(data)) { 
        args.cancel = true; 
      } 
    } 
  } 
 
Regards, 
Karthi 
 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon