# DateRange Auto-Correction

You can configure the `DateRangeStartInputDirective`, `DateRangeEndInputDirective`, and `DateRangeSelection` directives to automatically correct the range of dates that was selected.

When the selected range is invalid, for example, the `end` date is before the `start` date, the range will be fixed to a single date.

## Input Directives

Both `DateRangeStartInputDirective` and `DateRangeEndInputDirective` directives expose an [`autoCorrectOn`](https://www.telerik.com/kendo-angular-ui-develop/components/dateinputs/api/daterangestartinputdirective#autocorrecton) option that controls the time when the auto-correct features occurs. By default, the auto-correction is disabled.

The available options are:

* `blur`—Updates the range when the input gets blurred.
* `change`—Updates the range on every change in the input.
* `none`—Disables the auto-correction.

> The `DateRangeSelection` directive will be `deprecated` in a future version. We recommend using the MultiViewCalendar [`range selection`](https://www.telerik.com/kendo-angular-ui-develop/components/dateinputs/multiviewcalendar/selection-modes#range-selection).

The following example demonstrates how to enable the auto-correction on blur.

[Demo Source](https://demos.telerik.com/kendo-angular-ui/demos/dateinputs/daterange/autocorrect/input_directive/source.txt)

## Calendar Selection Directive

The `DateRangeSelection` directive is designed to auto-correct the selection range when the MultiViewCalendar changes. To disable the auto-correction, set the [`autoCorrectOn`](https://www.telerik.com/kendo-angular-ui-develop/components/dateinputs/api/daterangeselectiondirective#autocorrecton) option to `none`. By default, auto-correction is triggered on `change`.

The available options are:

* `blur`—Updates the range when the calendar gets blurred.
* `change`—Updates the range on every change in the calendar.
* `none`—Disables the auto-correction.

The following example demonstrates how to change the auto-correction behavior.

[Demo Source](https://demos.telerik.com/kendo-angular-ui/demos/dateinputs/daterange/autocorrect/calendar_selection_directive/source.txt)

## Suggested Links

* [API Reference of the DateRange](https://www.telerik.com/kendo-angular-ui-develop/components/dateinputs/api/daterangecomponent)
* [API Reference of the MultiViewCalendar](https://www.telerik.com/kendo-angular-ui-develop/components/dateinputs/api/multiviewcalendarcomponent)
* [`DateRangePopupComponent`](https://www.telerik.com/kendo-angular-ui-develop/components/dateinputs/api/daterangepopupcomponent)
* [`DateRangeSelectionDirective`](https://www.telerik.com/kendo-angular-ui-develop/components/dateinputs/api/daterangeselectiondirective)
* [`DateRangeStartInputDirective`](https://www.telerik.com/kendo-angular-ui-develop/components/dateinputs/api/daterangestartinputdirective)
* [`DateRangeEndInputDirective`](https://www.telerik.com/kendo-angular-ui-develop/components/dateinputs/api/daterangeendinputdirective)
