а

Dynamically generate slots/events from an event


#1

Hi,

Is it possible to dynamically generate slots/events using events?

For example, if I have an event, from 12 pm - 4 pm. Can I show 16 different events each of 15 minutes?

The goal is to allow the user to select a timeslot.

Thanks


#2

Hi,

Sorry, I am not sure that I fully understand your requirements.
Please clarify what do you mean by “to allow the user to select a timeslot”. I did not understand how this relates to 16 events.

16 different events can’t be a part of one big event, only separate events are available.

Possibly you want to create 1 event and as a result, get different events with duration = 15 minutes.
If so, you need to update end_date of the created event to make its duration = 15 min.

ev.end_date = scheduler.date.add(ev.start_date, 15, 'minute');

Then create new events by scheduler.addEvent during the range from new end_date till previous end_date value as it is in the createEvents() function in the snippet. Please check how it might be implemeted:
http://snippet.dhtmlx.com/08f74efef


#3

Hi @Polina,

Thanks for the update. Please let me explain it more.

  1. I’m working on an application similar to Calendly.

  2. The user can set his availability

1-July - 7-10 AM
2-July - 8-10 AM, 12-1 PM
3-July - 7-10 AM , 2-2:30 PM

This will create a total of 5 events (1 + 2 + 2).

  1. When someone will visit the user profile, he/she can select a duration of meeting/call, 15 mins, 30 mins, etc. And instead of a single large event, the user will see multiple smaller (15min, 30min) slots.

Assuming the user chose 9 AM to 9:15 on 1st July (15 min slot). A new event will be created for that duration, and the previous event will split in 2 events. 7 AM - 9 AM, 9 AM to 9:15 AM, 9:15-10 AM.

Thanks.


#4

Hi @Polina,

Just want to confirm if it supported or not before we get a license. It will be really helpful if you can answer this question, or maybe let me know if I should contact someone else in the sales team or something?

Thanks


#5

There is no inbuilt to split or merge the events dynamically in the dhtmlxScheduler.
You may try to refer to the dhtmlxGantt component. It should should be more suitable for your needs:
https://dhtmlx.com/docs/products/dhtmlxGantt/