layout | title | description | platform | control | documentation | domainurl |
---|---|---|---|---|---|---|
post |
Date range in Angular Calendar component | Syncfusion |
Learn here all about Date range in Syncfusion Angular Calendar component of Syncfusion Essential JS 2 and more. |
ej2-angular |
Date range |
ug |
You can restrict the user to select the date from a specified range of dates by utilizing the min
and max
properties. Always the min date has to be lesser than the max date.
The below example allows you to select a date within a range from 7th to 27th days in a month.
{% tabs %} {% highlight ts tabtitle="app.component.ts" %} {% include code-snippet/calendar/getting-started-cs6/src/app.component.ts %} {% endhighlight %}
{% highlight ts tabtitle="main.ts" %} {% include code-snippet/calendar/getting-started-cs6/src/main.ts %} {% endhighlight %} {% endtabs %}
{% previewsample "page.domainurl/samples/calendar/getting-started-cs6" %}
If the value of
min
ormax
properties changed through code behind, then you have to update thevalue
property to set within the range. Or else, if the value is out of specified date range and less thanmin
date, value property will be updated with min date or the value is higher than max date, value property will be updated withmax
date.