How to show/hide consecutive slots from date/time thing in database?

Hey all, I am developing an app which is like a LMS for Students and Teachers. Most of the user onboarding and class creation is being done by the admin. When the teacher is onboarded, an inventory is created for that teacher. That inventory is mapped over an year and no teacher can teach students outside of that inventory.

Each student has a different payment plan so let suppose “User X” subscribed for 15 mins class and “User Y” subscribed for 30 mins class, so now we have classes with different time variations e.g, 15mins, 30 mins and let suppose 45mins. So right now, what I am doing to create a slot interval is to take LCM of all these possible class times and split a time range with that LCM value and then assigning a class to the student. When assigning a class I am allowing the admin to pick a start date and then pick from one of these class time options.

This was a synopsis of what is being done. Now here is the problem. I want students and teachers to be able to generate a class reschedule request and when anyone of the user is generating a reschedule request, he is shown the available free slots of the respective teacher and what I really want to do is that for a user who has taken 30 mins class subscription, I want him to show two consecutive free slots of 15 mins.

Right now, I am storing a date range with the slots interval too so that if any class start date/time-end date/time lies in that range, it doesn’t show that slot but how to achieve this consecutive slot thing? Any help or hint will be highly appreciable.


Use one of the scheduling plugins like TopCal or full calendar scheduling suite

Hey @jared.gibb Thank you so much for your kind response but I am already scheduling the classes without the use of any plugin and everything is working perfectly fine. I am stuck at the point where I need to show two consecutive slots to a student who has taken a subscription of 30 mins class and currently the slots are divided into 15 mins so I need to show him two consecutive free slots (each of 15 mins). This is what I need help with

Are you still stuck on that?

Hey @raulperry
Solved it. Thanks for the kind response

This topic was automatically closed after 70 days. New replies are no longer allowed.