# Constraining Selection and Visible Dates

When certain dates are to be hidden or should not be selected by the user, the Calendar can hide or disable specific date ranges.

The following timeline shows how the selection and display ranges should relate to each other. All dates should fall between the **MinDate** and **MaxDate**, If **DisplayDateStart**/**End** are set, the **SelectableDates** range and all the selected dates must fall within it.

![WPF RadCalendar Selection Ranges](https://www.telerik.com/products/wpf/documentation/assets/7ce39f58de80d04caff32ac29a564953/calendar_selectionranges.png)

In the following example the Calendar has DisplayDateStart set to 6 Aug, while the SelectableDateStart is 14 Aug:

![calendar display Selectable Date Start 1](https://www.telerik.com/products/wpf/documentation/assets/4272db7678c9a1b925d29be624fd01d9/calendar_displayselectabledatestart1.png)

The **RadCalendar** has several static methods (**IsDisplayDateValid**, **IsDisplayDateStartValid**, **IsDisplayDateEndValid**, **IsSelectableDateStartValid**, **IsSelectableDateEndValid**) that can check whether the desired values are valid for the given calendar, for example:

```C#
if (RadCalendar.IsDisplayDateValid(calendar, DateTime.Today))
{
    calendar.DisplayDate = DateTime.Today;
}
if (RadCalendar.IsDisplayDateStartValid(calendar, DateTime.Today.AddDays(-13)))
{
    calendar.DisplayDateStart = DateTime.Today.AddDays(-13);
}
if (RadCalendar.IsSelectableDateStartValid(calendar, DateTime.Today.AddDays(-5)))
{
    calendar.SelectableDateStart = DateTime.Today.AddDays(-5);
}
```

To add constraints for specific dates, use the **TemplateSelector** properties.
