Set start date in Scheduler date selection

1 Answer 236 Views
Scheduler
Bernd
Top achievements
Rank 5
Bronze
Bronze
Bronze
Bernd asked on 28 Jun 2022, 01:37 PM

Hi.

In the Day-, Week- and Month view of the Scheduler a user can select the date to show in the header of the chosen view (see attached screenshots).

My question is if it is possible to limit what you can choose there. I would like to set a start date that should be the lowest date that a user can choose and disable all dates that are before that date. So for example a user shouldn't be able to choose a date before 1st of May 2022.

Is that possible?

Thanks,

Greetings,

Bernd

1 Answer, 1 is accepted

Sort by
1
Accepted
Konstantin Dikov
Telerik team
answered on 30 Jun 2022, 11:15 AM

Hello Bernd,

Currently the Scheduler does not have a min and max properties exposed for the navigator in the header, but you can use DatePickerPropsContext to set them. I have created a simple example demonstrating how you can achieve this through the context:

Hope this helps.

 

Regards,
Konstantin Dikov
Progress Telerik

The Premier Dev Conference is back! 

Coming to you live from Progress360 in-person or on your own time, DevReach for all. Register Today.


Bernd
Top achievements
Rank 5
Bronze
Bronze
Bronze
commented on 30 Jun 2022, 11:25 AM

Exactly what I needed. GREAT!

Thank you!

Bernd
Top achievements
Rank 5
Bronze
Bronze
Bronze
commented on 01 Jul 2022, 08:21 AM | edited

Hi again.

I just found that there is one issue left though. If I use the "Previous" and "Next" buttons, I can still go beyond the start date that I set with the context mentioned above. Is there a way to handle this?

 

Thanks,

Greetings,

Bernd

Konstantin Dikov
Telerik team
commented on 04 Jul 2022, 05:59 AM

Hi Bernd,

For handling the Next/Previous buttons you will have to control the date selection by using "date" and "onDateChange". Detailed information and example of this approach is available in the following help article:

Within the onDataChange you can check if the new value is within the range and change the "date" only when needed. 

Tags
Scheduler
Asked by
Bernd
Top achievements
Rank 5
Bronze
Bronze
Bronze
Answers by
Konstantin Dikov
Telerik team
Share this question
or