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

validate free slot comparing date and time

1 Answer 85 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
alveiro
Top achievements
Rank 1
Veteran
alveiro asked on 08 Jul 2020, 01:07 PM

Hi,
im working with scheduler component, and when i need to add an event, I need restrict the slot when it´s already is used.

I have used occurrencesInRange method but I need to compare the hours too.

mainly my need is to restrict when I have the date and time busy, I have looked in examples and they only validate occurrence of day.

 

Thanks.

1 Answer, 1 is accepted

Sort by
0
Accepted
Aleksandar
Telerik team
answered on 13 Jul 2020, 10:16 AM

Hello Alveiro,

I would suggest reviewing the Restrictions Demo that shows how to validate whether a resource is available for the specified period.

I am not sure I understand completely the issue you have experienced with the occurrencesInRange method. Could you please elaborate more on this? The method would return an array with all Scheduler events between a given start and end period. Each Scheduler event contains information on the start and end date and time for the event. Here is a sample dojo demonstrating a possible approach - if there is another event in the selected timeframe the event will not be added.

Finally, I can also suggest checking the ASP.NET MVC example in our codebase repository on how to validate a timeslot availability against existing recurrence rules. Though this is an ASP.NET MVC, but not an ASP.NET Core sample, you can follow the demonstrated approach and implement similar logic to validate time slot availability.

Regards,
Aleksandar
Progress Telerik

Tags
Scheduler
Asked by
alveiro
Top achievements
Rank 1
Veteran
Answers by
Aleksandar
Telerik team
Share this question
or