Class DateTimePickerBuilder
Inheritance
System.Object
DateTimePickerBuilder
Assembly: Syncfusion.EJ2.dll
Syntax
public class DateTimePickerBuilder : ControlBuilder
Constructors
DateTimePickerBuilder()
Declaration
public DateTimePickerBuilder()
DateTimePickerBuilder(DateTimePicker)
Declaration
public DateTimePickerBuilder(DateTimePicker model)
Parameters
Fields
model
Declaration
public DateTimePicker 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 DateTimePickerBuilder AllowEdit(bool allowEdit = true)
Parameters
Type |
Name |
Description |
System.Boolean |
allowEdit |
|
Returns
Blur(String)
Triggers when input loses the focus.
Declaration
public DateTimePickerBuilder 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 DateTimePickerBuilder CalendarMode(CalendarType calendarMode)
Parameters
Returns
Change(String)
Triggers when the Calendar value is changed.
Declaration
public DateTimePickerBuilder Change(string change)
Parameters
Type |
Name |
Description |
System.String |
change |
|
Returns
Cleared(String)
Triggers when datetimepicker value is cleared using clear button.
Declaration
public DateTimePickerBuilder Cleared(string cleared)
Parameters
Type |
Name |
Description |
System.String |
cleared |
|
Returns
Close(String)
Triggers when popup is closed.
Declaration
public DateTimePickerBuilder Close(string close)
Parameters
Type |
Name |
Description |
System.String |
close |
|
Returns
Created(String)
Triggers when DateTimePicker is created.
Declaration
public DateTimePickerBuilder 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 DateTimePickerBuilder 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 DateTimePickerBuilder 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 DateTimePickerBuilder Depth(CalendarView depth)
Parameters
Returns
Destroyed(String)
Triggers when DateTimePicker is destroyed.
Declaration
public DateTimePickerBuilder Destroyed(string destroyed)
Parameters
Type |
Name |
Description |
System.String |
destroyed |
|
Returns
Enabled(Boolean)
Specifies the component to be disabled or not.
Declaration
public DateTimePickerBuilder Enabled(bool enabled = true)
Parameters
Type |
Name |
Description |
System.Boolean |
enabled |
|
Returns
EnableMask(Boolean)
Specifies whether it is a masked datetimepicker or not.
By default the datetimepicker component render without masked input.
If you need masked datetimepicker input then specify it as true.
Declaration
public DateTimePickerBuilder 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 DateTimePickerBuilder 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 DateTimePickerBuilder 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 DateTimePickerBuilder 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 DateTimePickerBuilder FloatLabelType(FloatLabelType floatLabelType)
Parameters
Returns
Focus(String)
Triggers when input gets focus.
Declaration
public DateTimePickerBuilder 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 DateTimePickerBuilder 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 DateTimePickerBuilder 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='datetimepicker/htmlAttributes/index.md' %}{% endcodeBlock %}
Declaration
public DateTimePickerBuilder HtmlAttributes(object htmlAttributes)
Parameters
Type |
Name |
Description |
System.Object |
htmlAttributes |
|
Returns
KeyConfigs(Object)
Customizes the key actions in DateTimePicker.
For example, when using German keyboard, the key actions can be customized using these shortcuts.
Declaration
public DateTimePickerBuilder 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 DateTimePickerBuilder Locale(string locale)
Parameters
Type |
Name |
Description |
System.String |
locale |
|
Returns
MaskPlaceholder(DateTimePickerMaskPlaceholder)
Specifies the mask placeholder to be displayed on masked datetimepicker.
Declaration
public DateTimePickerBuilder MaskPlaceholder(DateTimePickerMaskPlaceholder maskPlaceholder)
Parameters
Returns
MaskPlaceholder(Action<DateTimePickerMaskPlaceholderBuilder>)
Declaration
public DateTimePickerBuilder MaskPlaceholder(Action<DateTimePickerMaskPlaceholderBuilder> maskPlaceholder)
Parameters
Returns
Max(Object)
Gets or sets the maximum date that can be selected in the DateTimePicker.
Declaration
public DateTimePickerBuilder 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 DateTimePicker.
Declaration
public DateTimePickerBuilder 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 DateTimePickerBuilder Navigated(string navigated)
Parameters
Type |
Name |
Description |
System.String |
navigated |
|
Returns
Open(String)
Triggers when popup is opened.
Declaration
public DateTimePickerBuilder Open(string open)
Parameters
Type |
Name |
Description |
System.String |
open |
|
Returns
OpenOnFocus(Boolean)
By default, the popup opens while clicking on the datetimepicker icon.
If you want to open the popup while focusing the datetime input then specify its value as true.
Declaration
public DateTimePickerBuilder OpenOnFocus(bool openOnFocus = true)
Parameters
Type |
Name |
Description |
System.Boolean |
openOnFocus |
|
Returns
Placeholder(String)
Specifies the placeholder text that to be is displayed in textbox.
Declaration
public DateTimePickerBuilder Placeholder(string placeholder)
Parameters
Type |
Name |
Description |
System.String |
placeholder |
|
Returns
Readonly(Boolean)
Declaration
public DateTimePickerBuilder 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 DateTimePickerBuilder RenderDayCell(string renderDayCell)
Parameters
Type |
Name |
Description |
System.String |
renderDayCell |
|
Returns
Specifies the scroll bar position if there is no value is selected in the timepicker popup list or
the given value is not present in the timepicker popup list.
{% codeBlock src='datetimepicker/scrollTo/index.md' %}{% endcodeBlock %}
Declaration
public DateTimePickerBuilder ScrollTo(object scrollTo)
Parameters
Type |
Name |
Description |
System.Object |
scrollTo |
|
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 DateTimePickerBuilder ServerTimezoneOffset(double serverTimezoneOffset)
Parameters
Type |
Name |
Description |
System.Double |
serverTimezoneOffset |
|
Returns
Specifies whether to show or hide the clear icon in textbox.
Declaration
public DateTimePickerBuilder 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 DateTimePickerBuilder 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 DateTimePickerBuilder Start(CalendarView start)
Parameters
Returns
Step(Double)
Specifies the time interval between the two adjacent time values in the time popup list .
Declaration
public DateTimePickerBuilder Step(double step)
Parameters
Type |
Name |
Description |
System.Double |
step |
|
Returns
StrictMode(Boolean)
Specifies the component to act as strict. So that, it allows to enter only a valid
date and time 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 value with highlighted error class.
Declaration
public DateTimePickerBuilder StrictMode(bool strictMode = true)
Parameters
Type |
Name |
Description |
System.Boolean |
strictMode |
|
Returns
Specifies the format of the time value that to be displayed in time popup list.
Declaration
public DateTimePickerBuilder TimeFormat(string timeFormat)
Parameters
Type |
Name |
Description |
System.String |
timeFormat |
|
Returns
Value(Object)
Gets or sets the selected date of the Calendar.
Declaration
public DateTimePickerBuilder 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 DateTimePickerBuilder 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 DateTimePickerBuilder WeekRule(WeekRule weekRule)
Parameters
Returns
Width(Double)
Specifies the width of the DatePicker component.
Declaration
public DateTimePickerBuilder Width(double width)
Parameters
Type |
Name |
Description |
System.Double |
width |
|
Returns
Width(String)
Specifies the width of the DatePicker component.
Declaration
public DateTimePickerBuilder Width(string width)
Parameters
Type |
Name |
Description |
System.String |
width |
|
Returns
ZIndex(Int32)
specifies the z-index value of the popup element.
Declaration
public DateTimePickerBuilder ZIndex(int zIndex)
Parameters
Type |
Name |
Description |
System.Int32 |
zIndex |
|
Returns