DateRangePickerModel
23 Sep 20257 minutes to read
Interface for a class DateRangePicker
Properties
blur EmitType<BlurEventArgs>
Triggers when the control loses the focus.
change EmitType<RangeEventArgs>
Triggers when the Calendar value is changed.
cleared EmitType<ClearedEventArgs>
Triggers when daterangepicker value is cleared using clear button.
close EmitType<Object>
Triggers when the DateRangePicker is closed.
created EmitType<Object>
Triggers when Calendar is created.
destroyed EmitType<Object>
Triggers when Calendar is destroyed.
focus EmitType<FocusEventArgs>
Triggers when the control gets focus.
navigated EmitType<NavigatedEventArgs>
Triggers when the Calendar is navigated to another view or within the same level of view.
open EmitType<Object>
Triggers when the DateRangePicker is opened.
renderDayCell EmitType<RenderDayCellEventArgs>
Triggers when each day cell of the Calendar is rendered.
select EmitType<Object>
Triggers on selecting the start and end date.
allowEdit boolean
Support for
allowEdithas been provided from
v16.2.46.
Specifies whether the input textbox is editable or not. Here the user can select the value from the
popup and cannot edit in the input textbox.
cssClass string
Sets the root CSS class to the DateRangePicker which allows you to customize the appearance.
dayHeaderFormat DayHeaderFormats
Specifies the format of the day that to be displayed in header. By default, the format is ‘short’.
Possible formats are:
-
Short- Sets the short format of day name (like Su ) in day header. -
Narrow- Sets the single character of day name (like S ) in day header. -
Abbreviated- Sets the min format of day name (like Sun ) in day header. -
Wide- Sets the long format of day name (like Sunday ) in day header.
depth CalendarView
Sets the maximum level of view (month, year, decade) in the Calendar.
Depth view should be smaller than the start view to restrict its view navigation.
enablePersistence boolean
Enable or disable the persisting component’s state between the page reloads. If enabled, following list of states will be persisted.
- startDate
- endDate
- value
enableRtl boolean
Enable or disable rendering component in right to left direction.
enabled boolean
Specifies the component to be disabled which prevents the DateRangePicker from user interactions.
endDate Date
Gets or sets the end date of the date range selection.
firstDayOfWeek number
Gets or sets the Calendar’s first day of the week. By default, the first day of the week will be based on the current culture.
For more details about firstDayOfWeek refer to
First day of weekdocumentation.
floatLabelType FloatLabelType|string
Specifies the placeholder text to be floated.
Possible values are:
Never: The label will never float in the input when the placeholder is available.
Always: The floating label will always float above the input.
Auto: The floating label will float above the input after focusing or entering a value in the input.
format string|RangeFormatObject
Sets or gets the required date format to the start and end date string.
For more details refer to
Formatsample.
fullScreenMode boolean
Specifies the component popup display full screen in mobile devices.
htmlAttributes { : }
You can add the additional html attributes such as disabled, value etc., to the element.
If you configured both property and equivalent html attribute then the component considers the property value.
<ejs-daterangepicker [htmlAttributes]="htmlAttributes"></ejs-daterangepicker>import { Component, ViewEncapsulation } from '@angular/core';
@Component({
selector: 'app-root',
styleUrls: ['app.component.css'],
templateUrl: 'app.component.html',
encapsulation: ViewEncapsulation.None
})
export class AppComponent {
constructor() { }
public htmlAttributes = { name: "range", placeholder:"Choose a range" };
}inputFormats string[]|RangeFormatObject[]
Specifies an array of acceptable date input formats for parsing user input.
keyConfigs { : }
Customizes the key actions in DateRangePicker.
For example, when using German keyboard, the key actions can be customized using these shortcuts.
Input Navigation
|
Key action |
Key |
|
altUpArrow |
alt+uparrow |
|
altDownArrow |
alt+downarrow |
|
escape |
escape |
Calendar Navigation (Use the following list of keys to navigate the currently focused Calendar after the popup has opened).
|
Key action |
Key |
|
controlUp |
ctrl+38 |
|
controlDown |
ctrl+40 |
|
moveDown |
downarrow |
pageUp |
pageup | </tr>
|
pageDown |
pagedown |
|
shiftPageUp |
shift+pageup |
|
shiftPageDown |
shift+pagedown |
|
moveUp |
uparrow |
|
moveLeft |
leftarrow |
|
moveRight |
rightarrow |
|
select |
enter |
|
home |
home |
|
end |
end |
|
controlHome |
ctrl+home |
|
controlEnd |
ctrl+end |
|
altUpArrow |
alt+uparrow |
|
spacebar |
space |
|
enter |
enter |
|
altRightArrow |
alt+rightarrow |
|
altLeftArrow |
alt+leftarrow |