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

[Solved] How to jump to next available month

1 Answer 151 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
Hans Gunnar
Top achievements
Rank 1
Hans Gunnar asked on 08 Apr 2009, 08:19 AM
Hi,

We're using the RadCalendar for showing available dates for a travel booking-service. We use the OnDayRender-event to disable days when it's not possible to book. This works like a charm. However, for a few travels it is only possible to book a few dates per year, for instance it may be possible to book only at 15th of january, 20th of april and 1st of september.
But if we disable all days except these ones we get a dialog-box saying "Date is out of range" if the user tries to navigate to the next month from April.

Would it be possible to let the calender automatically jump to next "valid" month (September) when the user tries to navigate to next month?

Btw, I agree this is not the most elegant solution when so few dates are actually available, but this is how the customer wants it as all travels should be booked in the same manner.

Edit: I notice that you won't get that error message I mentioned, but you have to go through all months from may to august (without any valid dates) before you get to september, so my question about jumping directly is still valid.

1 Answer, 1 is accepted

Sort by
0
Pavlina
Telerik team
answered on 10 Apr 2009, 03:55 PM
Hello Hans,

I suggest that you try OnDayRender event to show the month where the first available date is set as a focused date. In case of disabled date, explicitly change the calendar month with "valid" one (September).

Review the following live demo for more information about OnDayRender client-side event.

Greetings,
Pavlina
the Telerik team

Check out Telerik Trainer , the state of the art learning tool for Telerik products.
Tags
Calendar
Asked by
Hans Gunnar
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
Share this question
or