Class DatePickerBuilder
Inheritance
System.Object
DatePickerBuilder
Assembly: Syncfusion.EJ2.dll
Syntax
public class DatePickerBuilder : ControlBuilder
Constructors
DatePickerBuilder()
Declaration
public DatePickerBuilder()
DatePickerBuilder(DatePicker)
Declaration
public DatePickerBuilder(DatePicker model)
Parameters
Fields
model
Declaration
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 DatePickerBuilder AllowEdit(bool allowEdit = true)
Parameters
Type |
Name |
Description |
System.Boolean |
allowEdit |
|
Returns
Blur(String)
Triggers when the input loses the focus.
Declaration
public DatePickerBuilder Blur(string blur)
Parameters
Type |
Name |
Description |
System.String |
blur |
|
Returns
CalendarMode(CalendarType)
Gets or sets the Calendar's Type like gregorian or islamic.
Declaration
public DatePickerBuilder CalendarMode(CalendarType calendarMode)
Parameters
Returns
Change(String)
Triggers when the Calendar value is changed.
Declaration
public DatePickerBuilder Change(string change)
Parameters
Type |
Name |
Description |
System.String |
change |
|
Returns
Cleared(String)
Triggers when datepicker value is cleared using clear button.
Declaration
public DatePickerBuilder Cleared(string cleared)
Parameters
Type |
Name |
Description |
System.String |
cleared |
|
Returns
Close(String)
Triggers when the popup is closed.
Declaration
public DatePickerBuilder Close(string close)
Parameters
Type |
Name |
Description |
System.String |
close |
|
Returns
Created(String)
Triggers when the component is created.
Declaration
public DatePickerBuilder Created(string created)
Parameters
Type |
Name |
Description |
System.String |
created |
|
Returns
CssClass(String)
Specifies the root CSS class of the DatePicker that allows to
customize the appearance by overriding the styles.
Declaration
public DatePickerBuilder 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 DatePickerBuilder DayHeaderFormat(DayHeaderFormats dayHeaderFormat)
Parameters
Returns
Depth(CalendarView)
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 DatePickerBuilder Depth(CalendarView depth)
Parameters
Returns
Destroyed(String)
Triggers when the component is destroyed.
Declaration
public DatePickerBuilder Destroyed(string destroyed)
Parameters
Type |
Name |
Description |
System.String |
destroyed |
|
Returns
Enabled(Boolean)
Specifies the component to be disabled or not.
Declaration
public DatePickerBuilder Enabled(bool enabled = true)
Parameters
Type |
Name |
Description |
System.Boolean |
enabled |
|
Returns
EnableMask(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.
Declaration
public DatePickerBuilder EnableMask(bool enableMask = true)
Parameters
Type |
Name |
Description |
System.Boolean |
enableMask |
|
Returns
EnablePersistence(Boolean)
Enable or disable persisting component's state between page reloads. If enabled, following list of states will be persisted.
- value
Declaration
public DatePickerBuilder 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 DatePickerBuilder EnableRtl(bool enableRtl = true)
Parameters
Type |
Name |
Description |
System.Boolean |
enableRtl |
|
Returns
FirstDayOfWeek(Int32)
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 DatePickerBuilder FirstDayOfWeek(int firstDayOfWeek)
Parameters
Type |
Name |
Description |
System.Int32 |
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 DatePickerBuilder FloatLabelType(FloatLabelType floatLabelType)
Parameters
Returns
Focus(String)
Triggers when the input gets focus.
Declaration
public DatePickerBuilder Focus(string focus)
Parameters
Type |
Name |
Description |
System.String |
focus |
|
Returns
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.
Declaration
public DatePickerBuilder 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 DatePickerBuilder 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='datepicker/htmlAttributes/index.md' %}{% endcodeBlock %}
Declaration
public DatePickerBuilder HtmlAttributes(object htmlAttributes)
Parameters
Type |
Name |
Description |
System.Object |
htmlAttributes |
|
Returns
KeyConfigs(Object)
Customizes the key actions in DatePicker.
For example, when using German keyboard, the key actions can be customized using these shortcuts.
Declaration
public DatePickerBuilder 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 DatePickerBuilder Locale(string locale)
Parameters
Type |
Name |
Description |
System.String |
locale |
|
Returns
MaskPlaceholder(DatePickerMaskPlaceholder)
Specifies the mask placeholder to be displayed on masked datepicker.
Declaration
public DatePickerBuilder MaskPlaceholder(DatePickerMaskPlaceholder maskPlaceholder)
Parameters
Returns
MaskPlaceholder(Action<DatePickerMaskPlaceholderBuilder>)
Declaration
public DatePickerBuilder MaskPlaceholder(Action<DatePickerMaskPlaceholderBuilder> maskPlaceholder)
Parameters
Returns
Max(Object)
Gets or sets the maximum date that can be selected in the Calendar.
Declaration
public DatePickerBuilder Max(object max)
Parameters
Type |
Name |
Description |
System.Object |
max |
|
Returns
Min(Object)
Gets or sets the minimum date that can be selected in the Calendar.
Declaration
public DatePickerBuilder Min(object min)
Parameters
Type |
Name |
Description |
System.Object |
min |
|
Returns
Navigated(String)
Triggers when the Calendar is navigated to another level or within the same level of view.
Declaration
public DatePickerBuilder Navigated(string navigated)
Parameters
Type |
Name |
Description |
System.String |
navigated |
|
Returns
Open(String)
Triggers when the popup is opened.
Declaration
public DatePickerBuilder Open(string open)
Parameters
Type |
Name |
Description |
System.String |
open |
|
Returns
OpenOnFocus(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.
Declaration
public DatePickerBuilder OpenOnFocus(bool openOnFocus = true)
Parameters
Type |
Name |
Description |
System.Boolean |
openOnFocus |
|
Returns
Placeholder(String)
Specifies the placeholder text that displayed in textbox.
Declaration
public DatePickerBuilder Placeholder(string placeholder)
Parameters
Type |
Name |
Description |
System.String |
placeholder |
|
Returns
Readonly(Boolean)
Declaration
public DatePickerBuilder 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 DatePickerBuilder RenderDayCell(string renderDayCell)
Parameters
Type |
Name |
Description |
System.String |
renderDayCell |
|
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 DatePickerBuilder ServerTimezoneOffset(double serverTimezoneOffset)
Parameters
Type |
Name |
Description |
System.Double |
serverTimezoneOffset |
|
Returns
Specifies whether to show or hide the clear icon in textbox.
Declaration
public DatePickerBuilder ShowClearButton(bool showClearButton = true)
Parameters
Type |
Name |
Description |
System.Boolean |
showClearButton |
|
Returns
Specifies whether the today button is to be displayed or not.
Declaration
public DatePickerBuilder ShowTodayButton(bool showTodayButton = true)
Parameters
Type |
Name |
Description |
System.Boolean |
showTodayButton |
|
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 DatePickerBuilder Start(CalendarView start)
Parameters
Returns
StrictMode(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.
Declaration
public DatePickerBuilder StrictMode(bool strictMode = true)
Parameters
Type |
Name |
Description |
System.Boolean |
strictMode |
|
Returns
Value(Object)
Gets or sets the selected date of the Calendar.
Declaration
public DatePickerBuilder Value(object value)
Parameters
Type |
Name |
Description |
System.Object |
value |
|
Returns
WeekNumber(Boolean)
Determines whether the week number of the year is to be displayed in the calendar or not.
Declaration
public DatePickerBuilder 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 DatePickerBuilder WeekRule(WeekRule weekRule)
Parameters
Returns
Width(Double)
Specifies the width of the DatePicker component.
Declaration
public DatePickerBuilder Width(double width)
Parameters
Type |
Name |
Description |
System.Double |
width |
|
Returns
Width(String)
Specifies the width of the DatePicker component.
Declaration
public DatePickerBuilder Width(string width)
Parameters
Type |
Name |
Description |
System.String |
width |
|
Returns
ZIndex(Int32)
specifies the z-index value of the datePicker popup element.
Declaration
public DatePickerBuilder ZIndex(int zIndex)
Parameters
Type |
Name |
Description |
System.Int32 |
zIndex |
|
Returns