Kendo UI DateTimePicker TagHelper DateTimePickerTagHelper class.
Definition
Namespace:Kendo.Mvc.TagHelpers
Assembly:Kendo.Mvc.dll
Syntax:
[HtmlTargetElement("kendo-datetimepicker")]
[HtmlTargetElement("datetimepicker-editor", ParentTag = "form-item")]
[HtmlTargetElement("datetimepicker-editor", ParentTag = "property-grid-item")]
[RestrictChildren("messages", new string[] { "popup", "month-template", "label", "animation", "interval-settings", "aria-template" })]
[OutputElementHint("input")]
public class DateTimePickerTagHelper : CalendarBaseTagHelper, ITagHelper, ITagHelperComponent, IKendoFormEditor, ITemplateComponent
Inheritance: objectTagHelperTagHelperBaseCalendarBaseTagHelperDateTimePickerTagHelper
Implements:
Inherited Members
Example:
@addTagHelper *, Kendo.Mvc
<kendo-datetimepicker name="datetimepicker" value="DateTime.Today">
</kendo-datetimepicker>
Child Tags
Constructors
Initializes a new instance of the DateTimePickerTagHelper class.
public DateTimePickerTagHelper(IKendoHtmlGenerator generator)
Properties
Specifies the adaptive rendering of the component.
public AdaptiveMode? AdaptiveMode { get; set; }
Allows customization of the subtitle's text in the adaptive view of the component.
public string AdaptiveSubtitle { get; set; }
Allows customization of the title's text in the adaptive view of the component.
public string AdaptiveTitle { get; set; }
Specifies a template used to populate value of the aria-label attribute of the currently focused cell of the calendar. The parameters available for the template are: current - The current focused date.; valueType - The focused item value type - month, year and etc. or text - A text representing the focused value..
[HtmlAttributeName("ariatemplate")]
public string ARIATemplate { get; set; }
Specifies a template used to populate value of the aria-label attribute of the currently focused cell of the calendar. The parameters available for the template are: current - The current focused date.; valueType - The focused item value type - month, year and etc. or text - A text representing the focused value.. This option expects the name of a JavaScript function that will be called to return the template.
public string ARIATemplateHandler { get; set; }
Specifies a template used to populate value of the aria-label attribute of the currently focused cell of the calendar. The parameters available for the template are: current - The current focused date.; valueType - The focused item value type - month, year and etc. or text - A text representing the focused value.. This option expects the ID of the script element that contains the template.
[HtmlAttributeName("ariatemplate-id")]
public string ARIATemplateId { get; set; }
Specifies a template used to populate value of the aria-label attribute of the currently focused cell of the calendar. The parameters available for the template are: current - The current focused date.; valueType - The focused item value type - month, year and etc. or text - A text representing the focused value.. This option expects the IHtmlContent instance containing the created HTML.
public IHtmlContent ARIATemplateView { get; set; }
If this property is enabled and you have configured min and/or max values, and the user enters a value that falls out of that range, the value will automatically be set to either the minimum or maximum allowed value. This property has effect only when the dateInput of the component is enabled.
public bool? AutoAdjust { get; set; }
Sets a value that indicates whether to automatically correct the segment when out of range. In order to work, dateInput prop should be set to true.
public bool? AutoCorrectParts { get; set; }
Specifies the component type of the widget. "classic" - Uses the standard rendering of the widget. or "modern" - Uses new rendering with a fresh and modern look and feel..
public string ComponentType { get; set; }
Specifies the culture info used by the component. A valid kendo culture file must be added to the page in order for the example to work. <script src="https://cdn.jsdelivr.net/npm/@progress/kendo-ui@{version}/umd/cultures/kendo.culture.de-DE.min.js"></script>
public string Culture { get; set; }
Specifies if the DateTimePicker will use DateInput for editing value
public bool? DateInput { get; set; }
Specifies a list of dates, which will be passed to the month template of the DateView. All dates, which match the date portion of the selected date will be used to re-bind the TimeView.
public DateTime[] Dates { get; set; }
Specifies the navigation depth.
public CalendarView? Depth { get; set; }
An array or function that will be used to determine which dates to be disabled for selection by the widget.
public DateTime[] DisableDates { get; set; }
If set, specifies the latest time the TimeView can show.
public DateTime? EndTime { get; set; }
Sets a value controlling how the color is applied.
public FillMode? FillMode { get; set; }
The template which renders the footer of the calendar. If false, the footer will not be rendered.
public string Footer { get; set; }
An expression to be evaluated against the current model.
public ModelExpression For { get; set; }
Specifies the format, which is used to format the value of the DateTimePicker displayed in the input. The format also will be used to parse the input.For more information on date and time formats please refer to Date Formatting.
public string Format { get; set; }
Specifies the inputmode attribute of the inner <input /> element. It is used to specify the type of on-screen keyboard that should be displayed when the user focuses the input.
public string InputMode { get; set; }
Specifies the interval between values in the popup list. When the componentType is set to classic, the interval is specified in minutes (numeric values). or When the componentType is set to modern, the interval is specified as an object of hours, minutes and seconds..
public double? Interval { get; set; }
IsNested member.
[HtmlAttributeNotBound]
public bool IsNested { get; set; }
Implements:
Adds a label before the datetimepicker. If the datetimepicker has no id attribute, a generated id will be assigned. The string and the function parameters are setting the inner HTML of the label.
[HtmlAttributeName("label")]
public string LabelValue { get; set; }
Specifies the maximum date, which the calendar can show.
public DateTime? Max { get; set; }
Specifies the minimum date that the calendar can show.
public DateTime? Min { get; set; }
The name of the JavaScript function that will handle the change event. Triggered when the underlying value of a DateTimePicker is changed.
public string OnChange { get; set; }
The name of the JavaScript function that will handle the close event. Fires when the calendar or the time drop-down list is closed
public string OnClose { get; set; }
The name of the JavaScript function that will handle the kendoKeydown event. Triggered when the user presses a keyboard key while the DateTimePicker is focused.The event handler function context (available via the this keyword) will be set to the widget instance.
public string OnKendoKeydown { get; set; }
The name of the JavaScript function that will handle the open event. Fires when the calendar or the time drop-down list is opened
public string OnOpen { get; set; }
Specifies the formats, which are used to parse the value set with value() method or by direct input. If not set the value of the options.format and options.timeFormat will be used. Note that value of the format option is always used. The timeFormat value also will be used if defined.
public string[] ParseFormats { get; set; }
If set to true, the widget will be readonly and will not allow user input. The widget is not readonly be default and allow user input.
public bool? Readonly { get; set; }
Sets the size of the component.
public ComponentSize? Size { get; set; }
Specifies the start view of the calendar.
public CalendarView? Start { get; set; }
If set, specifies the earliest time the TimeView can show.
public DateTime? StartTime { get; set; }
Configures the templates for the DateTimePicker.
[HtmlAttributeNotBound]
public IDictionary<string, string> Templates { get; }
Implements:
Specifies the format, which is used to format the values in the time drop-down list.
public string TimeFormat { get; set; }
If set to true a week of the year will be shown on the left side of the calendar. It is possible to define a template in order to customize what will be displayed.
public bool? WeekNumber { get; set; }
Methods
Gets the initialization script.
protected override string GetInitializationScript()
The initialization script.
Overrides:
public override Task ProcessAsync(TagHelperContext context, TagHelperOutput output)
Overrides:
Serializes the defined settings.
public override IDictionary<string, object> Serialize()
Overrides:
SerializeEvents method.
protected override Dictionary<string, object> SerializeEvents()
Overrides:
SerializeSettings method.
protected override Dictionary<string, object> SerializeSettings()
Overrides:
Serializes the defined templates.
protected override Dictionary<string, object> SerializeTemplates()
Overrides:
TryAddAsEditor method.
public bool TryAddAsEditor(TagHelperContext context)
The result.
Implements:
Writes the HTML output.
protected override void WriteHtml(TagHelperOutput output)
The TagHelper output.
Overrides: