Class DateRangePicker
Inherited Members
Namespace: Syncfusion.EJ2.Calendars
Assembly: Syncfusion.EJ2.dll
Syntax
public class DateRangePicker : EJTagHelper
Constructors
DateRangePicker()
Declaration
public DateRangePicker()
Properties
AllowEdit
Support for
allowEdit
has been provided fromv16.2.46
.
Declaration
[HtmlAttributeName("allowEdit")]
public bool AllowEdit { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Blur
Triggers when the control loses the focus.
Declaration
[HtmlAttributeName("blur")]
public string Blur { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Change
Triggers when the Calendar value is changed.
Declaration
[HtmlAttributeName("change")]
public string Change { get; set; }
Property Value
Type | Description |
---|---|
System.String |
ClassName
Declaration
protected override string ClassName { get; }
Property Value
Type | Description |
---|---|
System.String |
Overrides
Cleared
Triggers when daterangepicker value is cleared using clear button.
Declaration
[HtmlAttributeName("cleared")]
public string Cleared { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Close
Triggers when the DateRangePicker is closed.
Declaration
[HtmlAttributeName("close")]
public string Close { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Created
Triggers when Calendar is created.
Declaration
[HtmlAttributeName("created")]
public string Created { get; set; }
Property Value
Type | Description |
---|---|
System.String |
CssClass
Sets the root CSS class to the DateRangePicker which allows you to customize the appearance.
Declaration
[HtmlAttributeName("cssClass")]
public string CssClass { get; set; }
Property Value
Type | Description |
---|---|
System.String |
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
[HtmlAttributeName("dayHeaderFormat")]
public DayHeaderFormats DayHeaderFormat { get; set; }
Property Value
Type | Description |
---|---|
DayHeaderFormats |
Depth
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.
Declaration
[HtmlAttributeName("depth")]
public CalendarView Depth { get; set; }
Property Value
Type | Description |
---|---|
CalendarView |
Destroyed
Triggers when Calendar is destroyed.
Declaration
[HtmlAttributeName("destroyed")]
public string Destroyed { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Enabled
Specifies the component to be disabled which prevents the DateRangePicker from user interactions.
Declaration
[HtmlAttributeName("enabled")]
public bool Enabled { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
EnablePersistence
Enable or disable the persisting component's state between the page reloads. If enabled, following list of states will be persisted.
- startDate
- endDate
- value
Declaration
[HtmlAttributeName("enablePersistence")]
public bool EnablePersistence { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
EnableRtl
Enable or disable rendering component in right to left direction.
Declaration
[HtmlAttributeName("enableRtl")]
public bool EnableRtl { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
EndDate
Gets or sets the end date of the date range selection.
Declaration
[HtmlAttributeName("endDate")]
public object EndDate { get; set; }
Property Value
Type | Description |
---|---|
System.Object |
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.
For more details about firstDayOfWeek refer to
First day of week
documentation.
Declaration
[HtmlAttributeName("firstDayOfWeek")]
public double FirstDayOfWeek { get; set; }
Property Value
Type | Description |
---|---|
System.Double |
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
[HtmlAttributeName("floatLabelType")]
public FloatLabelType FloatLabelType { get; set; }
Property Value
Type | Description |
---|---|
FloatLabelType |
Focus
Triggers when the control gets focus.
Declaration
[HtmlAttributeName("focus")]
public string Focus { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Format
Sets or gets the required date format to the start and end date string.
For more details refer to
Format
sample.
Declaration
[HtmlAttributeName("format")]
public string Format { get; set; }
Property Value
Type | Description |
---|---|
System.String |
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. {% codeBlock src='daterangepicker/htmlAttributes/index.md' %}{% endcodeBlock %}
Declaration
[HtmlAttributeName("htmlAttributes")]
public object HtmlAttributes { get; set; }
Property Value
Type | Description |
---|---|
System.Object |
IsFor
Declaration
protected override bool IsFor { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Overrides
KeyConfigs
Customizes the key actions in DateRangePicker. For example, when using German keyboard, the key actions can be customized using these shortcuts.
Declaration
[HtmlAttributeName("keyConfigs")]
public object KeyConfigs { get; set; }
Property Value
Type | Description |
---|---|
System.Object |
Locale
Overrides the global culture and localization value for this component. Default global culture is 'en-US'.
Declaration
[HtmlAttributeName("locale")]
public string Locale { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Max
Gets or sets the maximum date that can be selected in the calendar-popup.
Declaration
[HtmlAttributeName("max")]
public object Max { get; set; }
Property Value
Type | Description |
---|---|
System.Object |
MaxDays
Specifies the maximum span of days that can be allowed in a date range selection.
For more details refer to
Range Span
documentation.
Declaration
[HtmlAttributeName("maxDays")]
public int MaxDays { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
Min
Gets or sets the minimum date that can be selected in the calendar-popup.
Declaration
[HtmlAttributeName("min")]
public object Min { get; set; }
Property Value
Type | Description |
---|---|
System.Object |
MinDays
Specifies the minimum span of days that can be allowed in date range selection.
For more details refer to
Range Span
documentation.
Declaration
[HtmlAttributeName("minDays")]
public int MinDays { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
NameSpace
Declaration
protected override string NameSpace { get; }
Property Value
Type | Description |
---|---|
System.String |
Overrides
Navigated
Triggers when the Calendar is navigated to another view or within the same level of view.
Declaration
[HtmlAttributeName("navigated")]
public string Navigated { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Open
Triggers when the DateRangePicker is opened.
Declaration
[HtmlAttributeName("open")]
public string Open { get; set; }
Property Value
Type | Description |
---|---|
System.String |
OpenOnFocus
By default, the popup opens while clicking on the daterangepicker icon. If you want to open the popup while focusing the daterange input then specify its value as true.
Declaration
[HtmlAttributeName("openOnFocus")]
public bool OpenOnFocus { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Placeholder
Specifies the placeholder text that need to be displayed in the DateRangePicker component.
Declaration
[HtmlAttributeName("placeholder")]
public string Placeholder { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Presets
Set the predefined ranges which let the user pick required range easily in a component.
For more details refer to
Preset Ranges
documentation. {% codeBlock src='daterangepicker/presets/index.md' %}{% endcodeBlock %}
Declaration
[HtmlAttributeName("presets")]
public List<DateRangePickerPreset> Presets { get; set; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.List<DateRangePickerPreset> |
Readonly
Denies the editing the ranges in the DateRangePicker component.
Declaration
[HtmlAttributeName("readonly")]
public bool Readonly { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
RenderDayCell
Triggers when each day cell of the Calendar is rendered.
Declaration
[HtmlAttributeName("renderDayCell")]
public string RenderDayCell { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Select
Triggers on selecting the start and end date.
Declaration
[HtmlAttributeName("select")]
public string Select { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Separator
Sets or gets the string that used between the start and end date string.
Declaration
[HtmlAttributeName("separator")]
public string Separator { get; set; }
Property Value
Type | Description |
---|---|
System.String |
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
[HtmlAttributeName("serverTimezoneOffset")]
public double ServerTimezoneOffset { get; set; }
Property Value
Type | Description |
---|---|
System.Double |
ShowClearButton
Specifies whether to show or hide the clear icon
Declaration
[HtmlAttributeName("showClearButton")]
public bool ShowClearButton { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
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
[HtmlAttributeName("start")]
public CalendarView Start { get; set; }
Property Value
Type | Description |
---|---|
CalendarView |
StartDate
Gets or sets the start date of the date range selection.
Declaration
[HtmlAttributeName("startDate")]
public object StartDate { get; set; }
Property Value
Type | Description |
---|---|
System.Object |
StrictMode
Specifies the component to act as strict which allows entering only a valid date range in a DateRangePicker.
For more details refer to
Strict Mode
documentation.
Declaration
[HtmlAttributeName("strictMode")]
public bool StrictMode { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
TagName
Declaration
protected override string TagName { get; }
Property Value
Type | Description |
---|---|
System.String |
Overrides
Value
Gets or sets the start and end date of the Calendar. {% codeBlock src='daterangepicker/value/index.md' %}{% endcodeBlock %}
Declaration
[HtmlAttributeName("value")]
public object Value { get; set; }
Property Value
Type | Description |
---|---|
System.Object |
WeekNumber
Determines whether the week number of the Calendar is to be displayed or not. The week number is displayed in every week row.
For more details about weekNumber refer to
Calendar with week number
documentation.
Declaration
[HtmlAttributeName("weekNumber")]
public bool WeekNumber { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
WeekRule
Specifies the rule for defining the first week of the year.
Declaration
[HtmlAttributeName("weekRule")]
public WeekRule WeekRule { get; set; }
Property Value
Type | Description |
---|---|
WeekRule |
Width
Specifies the width of the DateRangePicker component.
Declaration
[HtmlAttributeName("width")]
public string Width { get; set; }
Property Value
Type | Description |
---|---|
System.String |
ZIndex
specifies the z-index value of the dateRangePicker popup element.
Declaration
[HtmlAttributeName("zIndex")]
public int ZIndex { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |