Class DatePicker
Inheritance
Namespace: Syncfusion.EJ2.Calendars
Assembly: Syncfusion.EJ2.dll
Syntax
public class DatePicker : EJTagHelper
Constructors
DatePicker()
Declaration
public DatePicker()
Properties
AllowEdit
Support for
allowEdit
has been provided fromv16.2.46
.
Declaration
public bool AllowEdit { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | The default value is true |
Blur
Triggers when the input loses the focus.
Declaration
public string Blur { get; set; }
Property Value
Type | Description |
---|---|
System.String | The default value is null |
CalendarMode
Gets or sets the Calendar's Type like gregorian or islamic.
Declaration
public CalendarType CalendarMode { get; set; }
Property Value
Type | Description |
---|---|
CalendarType | The default value is CalendarType.Gregorian |
Change
Triggers when the Calendar value is changed.
Declaration
public string Change { get; set; }
Property Value
Type | Description |
---|---|
System.String | The default value is null |
Cleared
Triggers when datepicker value is cleared using clear button.
Declaration
public string Cleared { get; set; }
Property Value
Type | Description |
---|---|
System.String | The default value is null |
Close
Triggers when the popup is closed.
Declaration
public string Close { get; set; }
Property Value
Type | Description |
---|---|
System.String | The default value is null |
Created
Triggers when the component is created.
Declaration
public string Created { get; set; }
Property Value
Type | Description |
---|---|
System.String | The default value is null |
CssClass
Specifies the root CSS class of the DatePicker that allows to customize the appearance by overriding the styles.
Declaration
public string CssClass { get; set; }
Property Value
Type | Description |
---|---|
System.String | The default value is null |
DayHeaderFormat
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.
Declaration
public DayHeaderFormats DayHeaderFormat { get; set; }
Property Value
Type | Description |
---|---|
DayHeaderFormats | The default value is DayHeaderFormats.Short |
Depth
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.
Declaration
public CalendarView Depth { get; set; }
Property Value
Type | Description |
---|---|
CalendarView | The default value is CalendarView.Month |
Destroyed
Triggers when the component is destroyed.
Declaration
public string Destroyed { get; set; }
Property Value
Type | Description |
---|---|
System.String | The default value is null |
Enabled
Specifies the component to be disabled or not.
Declaration
public bool Enabled { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | The default value is true |
EnableMask
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.
Declaration
public bool EnableMask { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | The default value is false |
EnablePersistence
Enable or disable persisting component's state between page reloads. If enabled, following list of states will be persisted.
- value
Declaration
public bool EnablePersistence { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | The default value is false |
EnableRtl
Enable or disable rendering component in right to left direction.
Declaration
public bool EnableRtl { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | The default value is false |
FirstDayOfWeek
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.
Declaration
public int FirstDayOfWeek { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 | The default value is 0 |
FloatLabelType
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.
Declaration
public FloatLabelType FloatLabelType { get; set; }
Property Value
Type | Description |
---|---|
FloatLabelType | The default value is Syncfusion.EJ2.Inputs.FloatLabelType.Never |
Focus
Triggers when the input gets focus.
Declaration
public string Focus { get; set; }
Property Value
Type | Description |
---|---|
System.String | The default value is null |
For
Declaration
public override ModelExpression For { get; set; }
Property Value
Type |
---|
Microsoft.AspNetCore.Mvc.ViewFeatures.ModelExpression |
Overrides
Format
Declaration
public string Format { get; set; }
Property Value
Type | Description |
---|---|
System.String | The default value is null |
FullScreenMode
Specifies the component popup display full screen in mobile devices.
Declaration
public bool FullScreenMode { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | The default value is false |
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.
Declaration
public object HtmlAttributes { get; set; }
Property Value
Type | Description |
---|---|
System.Object | The default value is null |
KeyConfigs
Customizes the key actions in DatePicker. For example, when using German keyboard, the key actions can be customized using these shortcuts.
Declaration
public object KeyConfigs { get; set; }
Property Value
Type | Description |
---|---|
System.Object | The default value is null |
Locale
Overrides the global culture and localization value for this component. Default global culture is 'en-US'.
Declaration
public string Locale { get; set; }
Property Value
Type | Description |
---|---|
System.String | The default value is "" |
MaskPlaceholder
Specifies the mask placeholder to be displayed on masked datepicker.
Declaration
public DatePickerMaskPlaceholder MaskPlaceholder { get; set; }
Property Value
Type | Description |
---|---|
DatePickerMaskPlaceholder | The default value is null |
Max
Gets or sets the maximum date that can be selected in the Calendar.
Declaration
public object Max { get; set; }
Property Value
Type | Description |
---|---|
System.Object | The default value is null |
Min
Gets or sets the minimum date that can be selected in the Calendar.
Declaration
public object Min { get; set; }
Property Value
Type | Description |
---|---|
System.Object | The default value is null |
Navigated
Triggers when the Calendar is navigated to another level or within the same level of view.
Declaration
public string Navigated { get; set; }
Property Value
Type | Description |
---|---|
System.String | The default value is null |
Open
Triggers when the popup is opened.
Declaration
public string Open { get; set; }
Property Value
Type | Description |
---|---|
System.String | The default value is null |
OpenOnFocus
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.
Declaration
public bool OpenOnFocus { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | The default value is false |
Placeholder
Specifies the placeholder text that displayed in textbox.
Declaration
public string Placeholder { get; set; }
Property Value
Type | Description |
---|---|
System.String | The default value is null |
Readonly
Specifies the component in readonly state. When the Component is readonly it does not allow user input.
Declaration
public bool Readonly { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | The default value is false |
RenderDayCell
Triggers when each day cell of the Calendar is rendered.
Declaration
public string RenderDayCell { get; set; }
Property Value
Type | Description |
---|---|
System.String | The default value is null |
ServerTimezoneOffset
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.
Declaration
public double ServerTimezoneOffset { get; set; }
Property Value
Type | Description |
---|---|
System.Double | The default value is Double.NaN |
ShowClearButton
Specifies whether to show or hide the clear icon in textbox.
Declaration
public bool ShowClearButton { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | The default value is true |
ShowTodayButton
Specifies whether the today button is to be displayed or not.
Declaration
public bool ShowTodayButton { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | The default value is true |
Start
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.
Declaration
public CalendarView Start { get; set; }
Property Value
Type | Description |
---|---|
CalendarView | The default value is CalendarView.Month |
StrictMode
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.
Declaration
public bool StrictMode { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | The default value is false |
Value
Gets or sets the selected date of the Calendar.
Declaration
public object Value { get; set; }
Property Value
Type | Description |
---|---|
System.Object | The default value is null |
WeekNumber
Determines whether the week number of the year is to be displayed in the calendar or not.
Declaration
public bool WeekNumber { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | The default value is false |
WeekRule
Specifies the rule for defining the first week of the year.
Declaration
public WeekRule WeekRule { get; set; }
Property Value
Type | Description |
---|---|
WeekRule | The default value is WeekRule.FirstDay |
Width
Specifies the width of the DatePicker component.
Declaration
public string Width { get; set; }
Property Value
Type | Description |
---|---|
System.String | The default value is null |
ZIndex
specifies the z-index value of the datePicker popup element.
Declaration
public int ZIndex { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 | The default value is 1000 |