You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<h2class="text-danger">An error occurred while processing your request.</h2>
5
+
6
+
<h3>Development Mode</h3>
7
+
<p>
8
+
Swapping to <strong>Development</strong> environment will display more detailed information about the error that occurred.
9
+
</p>
10
+
<p>
11
+
<strong>The Development environment shouldn't be enabled for deployed applications.</strong>
12
+
It can result in displaying sensitive information from exceptions to end users.
13
+
For local debugging, enable the <strong>Development</strong> environment by setting the <strong>ASPNETCORE_ENVIRONMENT</strong> environment variable to <strong>Development</strong>
This project demonstrates how you can implement an allowed dates parameter to disable dates
4
+
that are not included in your `AllowedDates` list.
5
+
6
+
## Description
7
+
8
+
Assume you have a calendar in which you want to disable only a small list of dates, you can achieve that using the clendars `DisabledDates` parameter, you can read more about it [here][TelerikCalendarSelection].
9
+
10
+
However, what if what you are trying to achieve is the opposite, you have a small list of allowed dates and you wish to disable the dates that are not included in your list.
11
+
12
+
## Implementation
13
+
14
+
As shown in [Index.razor][SourceCode] you have to call `DisableDates(DateTime)` function and pass it a date that is currently visible in your calendar.
15
+
This will detect what month(s) are currently displayed by your calendar and add the displayed days to the `DisabledDates` list iff they are not available in your `AllowedDates` list.
16
+
17
+
What happens if the user changes the current view?
18
+
Using the `DateChangedHandler` we call the `DisableDates(DateTime)` function to clear the old `DisabledDates` list and create a new list that contains the disabled days to the navigated view.
19
+
20
+
The project contains the following methods:
21
+
-`protected override void OnInitialized()`: Initializes the current view
22
+
-`void DateChangedHandler(DateTime)`: Is called when the user changes the current view
23
+
-`void DisableDates(DateTime)`: Is called to refresh `DisabledDates` list accordingly.
24
+
-`IEnumerable<DateTime> GetDisabledDates(DateTime)`: Gets the date range that are currently displayed by the view excep the dates already available in the `AllowedDates` list.
25
+
26
+
### Thanks
27
+
This contribution was made by [Hüssam Elvani][Contributor].
0 commit comments