Interface for a class DatePicker
EmitType<BlurEventArgs>
Triggers when the input loses the focus.
Triggers when the Calendar value is changed.
Triggers when datepicker value is cleared using clear button.
EmitType<
PreventableEventArgs
|PopupObjectArgs
>
Triggers when the popup is closed.
EmitType<Object>
Triggers when the component is created.
EmitType<Object>
Triggers when the component is destroyed.
EmitType<FocusEventArgs>
Triggers when the input gets focus.
Triggers when the Calendar is navigated to another level or within the same level of view.
EmitType<
PreventableEventArgs
|PopupObjectArgs
>
Triggers when the popup is opened.
EmitType<RenderDayCellEventArgs>
Triggers when each day cell of the Calendar is rendered.
boolean
Support for
allowEdit
has been provided fromv16.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.
Gets or sets the Calendar’s Type like gregorian or islamic.
string
Specifies the root CSS class of the DatePicker that allows to customize the appearance by overriding the styles.
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.Sets the maximum level of view such as month, year, and decade in the Calendar. Depth view should be smaller than the start view to restrict its view navigation.
boolean
Specifies whether it is a masked datepicker or not. By default the datepicker component render without masked input. If you need masked datepicker input then specify it as true.
boolean
Enable or disable persisting component’s state between page reloads. If enabled, following list of states will be persisted.
boolean
Enable or disable rendering component in right to left direction.
boolean
Specifies the component to be disabled or not.
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.
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.
string
| FormatObject
Specifies the format of the value that to be displayed in component. By default, the format is based on the culture. You can set the format to “format:‘dd/MM/yyyy hh:mm’” or “format:{skeleton:‘medium’}” either in string or object.
To know more about the date format standards, refer to the Internationalization Date Format
Internationalization
section.
boolean
Specifies the component popup display full screen in mobile devices.
{ : }
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.
<input id="datepicker" type="text">
import { DatePicker } from '@syncfusion/ej2-calendars';
let datepicker: DatePicker = new DatePicker({
htmlAttributes: { name: "appointment", placeholder:"Select a date" }
});
datepicker.appendTo('#datepicker');
string[]
| FormatObject[]
Specifies an array of acceptable date input formats for parsing user input.
{ : }
Customizes the key actions in DatePicker. 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
Key action |
Key |
controlUp |
ctrl+38 |
controlDown |
ctrl+40 |
moveDown |
downarrow |
moveUp |
uparrow |
moveLeft |
leftarrow |
moveRight |
rightarrow |
shiftPageUp |
shift+pageup |
shiftPageDown |
shift+pagedown |
select |
enter |
home |
home |
end |
end |
pageUp |
pageup |
pageDown |
pagedown |
controlHome |
ctrl+home |
controlEnd |
ctrl+end |
altUpArrow |
alt+uparrow |
spacebar |
space |
altRightArrow |
alt+rightarrow |
altLeftArrow |
alt+leftarrow |
<input id="datepicker" type="text">
import { DatePicker } from '@syncfusion/ej2-calendars';
let datepicker: DatePicker = new DatePicker({
keyConfigs:{
select: "space",
home: "ctrl+home",
end: "ctrl+end"
}
});
datepicker.appendTo('#datepicker');
string
Overrides the global culture and localization value for this component. Default global culture is ‘en-US’.
Specifies the mask placeholder to be displayed on masked datepicker.
Date
Gets or sets the maximum date that can be selected in the Calendar.
Date
Gets or sets the minimum date that can be selected in the Calendar.
boolean
By default, the popup opens while clicking on the datepicker icon. If you want to open the popup while focusing the date input then specify its value as true.
string
Specifies the placeholder text that displayed in textbox.
boolean
Specifies the component in readonly state. When the Component is readonly it does not allow user input.
number
By default, the date value will be processed based on system time zone.
If you want to process the initial date value using server time zone
then specify the time zone value to serverTimezoneOffset
property.
boolean
Specifies whether to show or hide the clear icon in textbox.
boolean
Specifies whether the today button is to be displayed or not.
Specifies the initial view of the Calendar when it is opened. With the help of this property, initial view can be changed to year or decade view.
boolean
Specifies the component to act as strict. So that, it allows to enter only a valid date value within a specified range or else it will resets to previous value. By default, strictMode is in false. it allows invalid or out-of-range date value with highlighted error class.
Date
Gets or sets the selected date of the Calendar.
boolean
Determines whether the week number of the year is to be displayed in the calendar or not.
Specifies the rule for defining the first week of the year.
number
| string
Specifies the width of the DatePicker component.
number
specifies the z-index value of the datePicker popup element.