Class DateRangePickerBuilder
Inheritance
System.Object
DateRangePickerBuilder
Assembly: Syncfusion.EJ2.dll
Syntax
public class DateRangePickerBuilder : ControlBuilder
Constructors
DateRangePickerBuilder()
Declaration
public DateRangePickerBuilder()
DateRangePickerBuilder(DateRangePicker)
Declaration
public DateRangePickerBuilder(DateRangePicker model)
Parameters
Fields
model
Declaration
public DateRangePicker model
Field Value
Properties
HtmlAttr
Declaration
public IDictionary<string, object> HtmlAttr { get; set; }
Property Value
Type |
Description |
System.Collections.Generic.IDictionary<System.String, System.Object> |
|
ID
Declaration
public string ID { get; set; }
Property Value
Type |
Description |
System.String |
|
Output
Declaration
public override TextWriter Output { get; set; }
Property Value
Type |
Description |
System.IO.TextWriter |
|
Overrides
Methods
AllowEdit(Boolean)
Support for allowEdit
has been provided from
v16.2.46
.
Declaration
public DateRangePickerBuilder AllowEdit(bool allowEdit = true)
Parameters
Type |
Name |
Description |
System.Boolean |
allowEdit |
|
Returns
Blur(String)
Triggers when the control loses the focus.
Declaration
public DateRangePickerBuilder Blur(string blur)
Parameters
Type |
Name |
Description |
System.String |
blur |
|
Returns
Change(String)
Triggers when the Calendar value is changed.
Declaration
public DateRangePickerBuilder Change(string change)
Parameters
Type |
Name |
Description |
System.String |
change |
|
Returns
Cleared(String)
Triggers when daterangepicker value is cleared using clear button.
Declaration
public DateRangePickerBuilder Cleared(string cleared)
Parameters
Type |
Name |
Description |
System.String |
cleared |
|
Returns
Close(String)
Triggers when the DateRangePicker is closed.
Declaration
public DateRangePickerBuilder Close(string close)
Parameters
Type |
Name |
Description |
System.String |
close |
|
Returns
Created(String)
Triggers when Calendar is created.
Declaration
public DateRangePickerBuilder Created(string created)
Parameters
Type |
Name |
Description |
System.String |
created |
|
Returns
CssClass(String)
Sets the root CSS class to the DateRangePicker which allows you to customize the appearance.
Declaration
public DateRangePickerBuilder CssClass(string cssClass)
Parameters
Type |
Name |
Description |
System.String |
cssClass |
|
Returns
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 DateRangePickerBuilder DayHeaderFormat(DayHeaderFormats dayHeaderFormat)
Parameters
Returns
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.
Declaration
public DateRangePickerBuilder Depth(CalendarView depth)
Parameters
Returns
Destroyed(String)
Triggers when Calendar is destroyed.
Declaration
public DateRangePickerBuilder Destroyed(string destroyed)
Parameters
Type |
Name |
Description |
System.String |
destroyed |
|
Returns
Enabled(Boolean)
Specifies the component to be disabled which prevents the DateRangePicker from user interactions.
Declaration
public DateRangePickerBuilder Enabled(bool enabled = true)
Parameters
Type |
Name |
Description |
System.Boolean |
enabled |
|
Returns
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
Declaration
public DateRangePickerBuilder EnablePersistence(bool enablePersistence = true)
Parameters
Type |
Name |
Description |
System.Boolean |
enablePersistence |
|
Returns
EnableRtl(Boolean)
Enable or disable rendering component in right to left direction.
Declaration
public DateRangePickerBuilder EnableRtl(bool enableRtl = true)
Parameters
Type |
Name |
Description |
System.Boolean |
enableRtl |
|
Returns
EndDate(Object)
Gets or sets the end date of the date range selection.
Declaration
public DateRangePickerBuilder EndDate(object endDate)
Parameters
Type |
Name |
Description |
System.Object |
endDate |
|
Returns
FirstDayOfWeek(Double)
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
public DateRangePickerBuilder FirstDayOfWeek(double firstDayOfWeek)
Parameters
Type |
Name |
Description |
System.Double |
firstDayOfWeek |
|
Returns
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 DateRangePickerBuilder FloatLabelType(FloatLabelType floatLabelType)
Parameters
Returns
Focus(String)
Triggers when the control gets focus.
Declaration
public DateRangePickerBuilder Focus(string focus)
Parameters
Type |
Name |
Description |
System.String |
focus |
|
Returns
Sets or gets the required date format to the start and end date string.
For more details refer to
Format
sample.
Declaration
public DateRangePickerBuilder Format(string format)
Parameters
Type |
Name |
Description |
System.String |
format |
|
Returns
FullScreenMode(Boolean)
Specifies the component popup display full screen in mobile devices.
Declaration
public DateRangePickerBuilder FullScreenMode(bool fullScreenMode = true)
Parameters
Type |
Name |
Description |
System.Boolean |
fullScreenMode |
|
Returns
HtmlAttributes(Object)
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
public DateRangePickerBuilder HtmlAttributes(object htmlAttributes)
Parameters
Type |
Name |
Description |
System.Object |
htmlAttributes |
|
Returns
KeyConfigs(Object)
Customizes the key actions in DateRangePicker.
For example, when using German keyboard, the key actions can be customized using these shortcuts.
Declaration
public DateRangePickerBuilder KeyConfigs(object keyConfigs)
Parameters
Type |
Name |
Description |
System.Object |
keyConfigs |
|
Returns
Locale(String)
Overrides the global culture and localization value for this component. Default global culture is 'en-US'.
Declaration
public DateRangePickerBuilder Locale(string locale)
Parameters
Type |
Name |
Description |
System.String |
locale |
|
Returns
Max(Object)
Gets or sets the maximum date that can be selected in the calendar-popup.
Declaration
public DateRangePickerBuilder Max(object max)
Parameters
Type |
Name |
Description |
System.Object |
max |
|
Returns
MaxDays(Int32)
Specifies the maximum span of days that can be allowed in a date range selection.
For more details refer to
Range Span
documentation.
Declaration
public DateRangePickerBuilder MaxDays(int maxDays)
Parameters
Type |
Name |
Description |
System.Int32 |
maxDays |
|
Returns
Min(Object)
Gets or sets the minimum date that can be selected in the calendar-popup.
Declaration
public DateRangePickerBuilder Min(object min)
Parameters
Type |
Name |
Description |
System.Object |
min |
|
Returns
MinDays(Int32)
Specifies the minimum span of days that can be allowed in date range selection.
For more details refer to
Range Span
documentation.
Declaration
public DateRangePickerBuilder MinDays(int minDays)
Parameters
Type |
Name |
Description |
System.Int32 |
minDays |
|
Returns
Navigated(String)
Triggers when the Calendar is navigated to another view or within the same level of view.
Declaration
public DateRangePickerBuilder Navigated(string navigated)
Parameters
Type |
Name |
Description |
System.String |
navigated |
|
Returns
Open(String)
Triggers when the DateRangePicker is opened.
Declaration
public DateRangePickerBuilder Open(string open)
Parameters
Type |
Name |
Description |
System.String |
open |
|
Returns
OpenOnFocus(Boolean)
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
public DateRangePickerBuilder OpenOnFocus(bool openOnFocus = true)
Parameters
Type |
Name |
Description |
System.Boolean |
openOnFocus |
|
Returns
Placeholder(String)
Specifies the placeholder text that need to be displayed in the DateRangePicker component.
Declaration
public DateRangePickerBuilder Placeholder(string placeholder)
Parameters
Type |
Name |
Description |
System.String |
placeholder |
|
Returns
Presets(Action<DateRangePickerPresetBuilder>)
Declaration
public DateRangePickerBuilder Presets(Action<DateRangePickerPresetBuilder> presets)
Parameters
Returns
Presets(List<DateRangePickerPreset>)
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
public DateRangePickerBuilder Presets(List<DateRangePickerPreset> presets)
Parameters
Returns
Readonly(Boolean)
Declaration
public DateRangePickerBuilder Readonly(bool readOnly = true)
Parameters
Type |
Name |
Description |
System.Boolean |
readOnly |
|
Returns
Render()
Declaration
public HtmlString Render()
Returns
Type |
Description |
Microsoft.AspNetCore.Html.HtmlString |
|
RenderDayCell(String)
Triggers when each day cell of the Calendar is rendered.
Declaration
public DateRangePickerBuilder RenderDayCell(string renderDayCell)
Parameters
Type |
Name |
Description |
System.String |
renderDayCell |
|
Returns
Select(String)
Triggers on selecting the start and end date.
Declaration
public DateRangePickerBuilder Select(string select)
Parameters
Type |
Name |
Description |
System.String |
select |
|
Returns
Separator(String)
Sets or gets the string that used between the start and end date string.
Declaration
public DateRangePickerBuilder Separator(string separator)
Parameters
Type |
Name |
Description |
System.String |
separator |
|
Returns
ServerTimezoneOffset(Double)
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 DateRangePickerBuilder ServerTimezoneOffset(double serverTimezoneOffset)
Parameters
Type |
Name |
Description |
System.Double |
serverTimezoneOffset |
|
Returns
Specifies whether to show or hide the clear icon
Declaration
public DateRangePickerBuilder ShowClearButton(bool showClearButton = true)
Parameters
Type |
Name |
Description |
System.Boolean |
showClearButton |
|
Returns
Start(CalendarView)
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 DateRangePickerBuilder Start(CalendarView start)
Parameters
Returns
StartDate(Object)
Gets or sets the start date of the date range selection.
Declaration
public DateRangePickerBuilder StartDate(object startDate)
Parameters
Type |
Name |
Description |
System.Object |
startDate |
|
Returns
StrictMode(Boolean)
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
public DateRangePickerBuilder StrictMode(bool strictMode = true)
Parameters
Type |
Name |
Description |
System.Boolean |
strictMode |
|
Returns
Value(DateRangePickerDateRange)
Gets or sets the start and end date of the Calendar.
{% codeBlock src='daterangepicker/value/index.md' %}{% endcodeBlock %}
Declaration
public DateRangePickerBuilder Value(DateRangePickerDateRange value)
Parameters
Returns
Value(Action<DateRangePickerDateRangeBuilder>)
Declaration
public DateRangePickerBuilder Value(Action<DateRangePickerDateRangeBuilder> value)
Parameters
Returns
Value(Object)
Gets or sets the start and end date of the Calendar.
{% codeBlock src='daterangepicker/value/index.md' %}{% endcodeBlock %}
Declaration
public DateRangePickerBuilder Value(object value)
Parameters
Type |
Name |
Description |
System.Object |
value |
|
Returns
WeekNumber(Boolean)
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
public DateRangePickerBuilder WeekNumber(bool weekNumber = true)
Parameters
Type |
Name |
Description |
System.Boolean |
weekNumber |
|
Returns
WeekRule(WeekRule)
Specifies the rule for defining the first week of the year.
Declaration
public DateRangePickerBuilder WeekRule(WeekRule weekRule)
Parameters
Returns
Width(Double)
Specifies the width of the DateRangePicker component.
Declaration
public DateRangePickerBuilder Width(double width)
Parameters
Type |
Name |
Description |
System.Double |
width |
|
Returns
Width(String)
Specifies the width of the DateRangePicker component.
Declaration
public DateRangePickerBuilder Width(string width)
Parameters
Type |
Name |
Description |
System.String |
width |
|
Returns
ZIndex(Int32)
specifies the z-index value of the dateRangePicker popup element.
Declaration
public DateRangePickerBuilder ZIndex(int zIndex)
Parameters
Type |
Name |
Description |
System.Int32 |
zIndex |
|
Returns