Class SfTimePicker<TValue>
TimePicker is an intuitive component which provides an options to select a time value from popup list or to set a desired time value.
Inherited Members
Namespace: Syncfusion.Blazor.Calendars
Assembly: Syncfusion.Blazor.dll
Syntax
public class SfTimePicker<TValue> : SfInputTextBase<TValue>, IMaskPlaceholder
Type Parameters
Name |
---|
TValue |
Constructors
SfTimePicker()
Declaration
public SfTimePicker()
Properties
AllowEdit
Gets or sets a boolean value to AllowEdit whether the SfTimePicker<TValue> allows user to change the value via typing.
Declaration
public bool AllowEdit { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
BaseFloatLabelType
Declaration
protected override FloatLabelType BaseFloatLabelType { get; set; }
Property Value
Type |
---|
FloatLabelType |
Overrides
BaseHtmlAttributes
Declaration
protected override Dictionary<string, object> BaseHtmlAttributes { get; set; }
Property Value
Type |
---|
System.Collections.Generic.Dictionary<System.String, System.Object> |
Overrides
BaseInputAttributes
Declaration
protected override Dictionary<string, object> BaseInputAttributes { get; set; }
Property Value
Type |
---|
System.Collections.Generic.Dictionary<System.String, System.Object> |
Overrides
BaseIsReadOnlyInput
Declaration
protected override bool BaseIsReadOnlyInput { get; set; }
Property Value
Type |
---|
System.Boolean |
Overrides
BasePlaceholder
Declaration
protected override string BasePlaceholder { get; set; }
Property Value
Type |
---|
System.String |
Overrides
BaseReadonly
Declaration
protected override bool BaseReadonly { get; set; }
Property Value
Type |
---|
System.Boolean |
Overrides
BaseShowClearButton
Declaration
protected override bool BaseShowClearButton { get; set; }
Property Value
Type |
---|
System.Boolean |
Overrides
BaseTabIndex
Declaration
protected override int BaseTabIndex { get; set; }
Property Value
Type |
---|
System.Int32 |
Overrides
BaseWidth
Declaration
protected override string BaseWidth { get; set; }
Property Value
Type |
---|
System.String |
Overrides
EnableMask
Gets or sets mask rendering in the SfTimePicker<TValue> component.
Declaration
public bool EnableMask { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
Remarks
The Enable mask property restricts the user to type the unwanted characters in the text area. It allows only eligible characters to type.
FloatLabelType
Gets or sets the FloatLabelType behavior of the TextBox that the Placeholder text floats above the TextBox based on the following values.
Possible values are:
- NeverNever floats the label in the TextBox when the placeholder is available.
- AlwaysThe floating label always floats above the TextBox.
- AutoThe floating label floats above the TextBox after focusing it or when enters the value in it.
Declaration
public FloatLabelType FloatLabelType { get; set; }
Property Value
Type |
---|
FloatLabelType |
Format
Gets or sets the required time Format of value that is to be displayed in component.
By default, the format is based on the culture.
Declaration
public string Format { get; set; }
Property Value
Type | Description |
---|---|
System.String | Accepts format value in string type. The default culture format is |
FullScreen
Gets or sets a boolean value to FullScreen this indicates whether to enable full screen layout for SfTimePicker<TValue> component popup in mobile devices or not.
Declaration
public bool FullScreen { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
Remarks
The FullScreen property applicable for mobile and tablet devices only.
HtmlAttributes
Gets or sets the additional HtmlAttributes such as styles, class, and more to the root element.
Declaration
public Dictionary<string, object> HtmlAttributes { get; set; }
Property Value
Type |
---|
System.Collections.Generic.Dictionary<System.String, System.Object> |
Remarks
Additional attributes can be added by specifying an inline attribute or by specifying @attributes directive.
InputAttributes
Gets or sets the additional InputAttributes such as disabled, value, and more to the root element.
Declaration
public Dictionary<string, object> InputAttributes { get; set; }
Property Value
Type |
---|
System.Collections.Generic.Dictionary<System.String, System.Object> |
Remarks
If you configured both property and equivalent input attribute, then the component considers the property value.
InputFormats
Gets or sets the array of InputFormats to be used for parsing date values in the SfTimePicker<TValue> component.
Declaration
public string[] InputFormats { get; set; }
Property Value
Type | Description |
---|---|
System.String[] | An array of strings representing the acceptable input formats for date values. The default value is |
Remarks
This property allows the SfTimePicker<TValue> to interpret typed date values using a specified array of formats.
The formats can include both standard and custom formats supported in C#. When both InputFormats
and Format
properties are specified, the InputFormats
property takes priority.
If only InputFormats
is specified, parsing will be attempted using the formats provided in the array.
If neither property is specified, the default behavior remains unchanged.
The parsing logic prioritizes the formats in the order they are specified in the InputFormats
array.
If a successful parsing occurs, the SfTimePicker<TValue> updates its value accordingly. Error handling is controlled by the StrictMode
property, allowing for different user experiences in case of invalid input.
Examples
The following example demonstrates how to set the InputFormats
property to accept multiple date formats:
KeyConfigs
Gets or sets the shortcuts keys KeyConfigs in SfTimePicker<TValue> component.
Declaration
public Dictionary<string, object> KeyConfigs { get; set; }
Property Value
Type |
---|
System.Collections.Generic.Dictionary<System.String, System.Object> |
Remarks
When using German keyboard, the key actions can be customized using these shortcuts.
Max
Gets or sets the maximum time value that can be allowed to select in TimePicker.
Declaration
public DateTime Max { get; set; }
Property Value
Type | Description |
---|---|
System.DateTime | The maximum time that can be allowed to select in TimePicker. |
Min
Gets or sets the minimum time value that can be allowed to select in TimePicker.
Declaration
public DateTime Min { get; set; }
Property Value
Type | Description |
---|---|
System.DateTime | The minimum time that value must be less than or equal to the Max value in TimePicker. |
Placeholder
Gets or sets the text that is shown as a hint or Placeholder until the user focuses or enter a value in TimePicker.
Declaration
public string Placeholder { get; set; }
Property Value
Type | Description |
---|---|
System.String | Accepts a string value. The default value is |
Remarks
The property is depending on the FloatLabelType property.
Readonly
Gets or sets the boolean value to Readonly whether the SfTimePicker<TValue> allows the user to change the text.
Declaration
public bool Readonly { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
ScrollTo
Gets or sets the scroll bar position.
Declaration
public Nullable<DateTime> ScrollTo { get; set; }
Property Value
Type | Description |
---|---|
System.Nullable<System.DateTime> | A Datetime value is set to ScrollTo property. If there is no value is selected in the popup list or the given value is not present in the popup list. |
ShowClearButton
Gets or sets a boolean value to ShowClearButton this indicates whether the clear button is displayed in SfTimePicker<TValue> component.
Declaration
public bool ShowClearButton { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
Step
Gets or sets the time interval. This time interval between the two adjacent time values in the popup list.
Declaration
public int Step { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 | Accepts a integer value. The default value is |
StrictMode
Gets or sets the component to act as strict So that it allows to enter of only a valid date value within a specified range, or else it will reset to the previous value.
Declaration
public bool StrictMode { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
TabIndex
Gets or sets the TabIndex order of the TimePicker component.
Declaration
public int TabIndex { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 | Accepts integer value. The default value is |
TimePickerEditContext
Gets or sets the edit context of timepicker.
Declaration
protected EditContext TimePickerEditContext { get; set; }
Property Value
Type |
---|
Microsoft.AspNetCore.Components.Forms.EditContext |
Width
Gets or sets the Width of the SfTimePicker<TValue> component.
Declaration
public string Width { get; set; }
Property Value
Type | Description |
---|---|
System.String | Accepts a string value. The default value is |
ZIndex
Gets or sets the ZIndex value of the TimePicker popup element.
Declaration
public int ZIndex { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 | Accepts integer value. The default value is |
Methods
BuildRenderTree(RenderTreeBuilder)
Declaration
protected override void BuildRenderTree(RenderTreeBuilder __builder)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder | __builder |
ChangeHandler(ChangeEventArgs)
Declaration
protected override Task ChangeHandler(ChangeEventArgs args)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.AspNetCore.Components.ChangeEventArgs | args |
Returns
Type |
---|
System.Threading.Tasks.Task |
Overrides
CreateMask()
Declaration
protected Task CreateMask()
Returns
Type |
---|
System.Threading.Tasks.Task |
FocusAsync()
Sets the focus to the TimePicker component for interaction.
Declaration
public Task FocusAsync()
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | Task. |
FocusHandler(FocusEventArgs)
Declaration
protected override Task FocusHandler(FocusEventArgs args)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.AspNetCore.Components.Web.FocusEventArgs | args |
Returns
Type |
---|
System.Threading.Tasks.Task |
Overrides
FocusOutAsync()
Remove the focus from the TimePicker component, if the component is in focus state.
Declaration
public Task FocusOutAsync()
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | Task. |
FocusOutHandler(FocusEventArgs)
Declaration
protected override Task FocusOutHandler(FocusEventArgs args)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.AspNetCore.Components.Web.FocusEventArgs | args |
Returns
Type |
---|
System.Threading.Tasks.Task |
Overrides
FormatValue(String)
Declaration
protected override TValue FormatValue(string genericValue = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | genericValue |
Returns
Type |
---|
TValue |
Overrides
FormatValueAsString(TValue)
Declaration
protected override string FormatValueAsString(TValue formatValue)
Parameters
Type | Name | Description |
---|---|---|
TValue | formatValue |
Returns
Type |
---|
System.String |
Overrides
GetPersistDataAsync()
Gets the properties to be maintained in the persisted state.
Declaration
public Task<string> GetPersistDataAsync()
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.String> | Task. |
HidePopupAsync(EventArgs)
Hides the TimePicker popup.
Declaration
public Task HidePopupAsync(EventArgs args = null)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | args |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | Task. |
InputHandler(ChangeEventArgs)
Declaration
protected override Task InputHandler(ChangeEventArgs args)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.AspNetCore.Components.ChangeEventArgs | args |
Returns
Type |
---|
System.Threading.Tasks.Task |
Overrides
OnAfterRenderAsync(Boolean)
Triggers after the component get rendered.
Declaration
protected override Task OnAfterRenderAsync(bool firstRender)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | firstRender | true if the component rendered for the first time. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | The System.Threading.Tasks.Task. |
Overrides
OnInitializedAsync()
Triggers while initial rendering of the component.
Declaration
protected override Task OnInitializedAsync()
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | The System.Threading.Tasks.Task. |
Overrides
OnParametersSetAsync()
Triggers while dynamically changing the properties of the component.
Declaration
protected override Task OnParametersSetAsync()
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | The System.Threading.Tasks.Task. |
Overrides
ShowPopupAsync(EventArgs)
Opens the popup to show the list items.
Declaration
public Task ShowPopupAsync(EventArgs args = null)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | args |
Returns
Type |
---|
System.Threading.Tasks.Task |