TimePicker
Picking a time can be tough without context. A BitTimePicker offers a drop-down control that’s optimized for picking a single time from a clock view where contextual information like the day of the week or fullness of the calendar is important. You can modify the calendar to provide additional context or to limit available times.
Usage
Default BitTimePicker
:
13
14
15
16
17
18
19
20
21
22
23
00
01
02
03
04
05
06
07
08
09
10
11
12
BitTimePicker with 12 hours (AM/PM)
:
1
2
3
4
5
6
7
8
9
10
11
12
Disabled BitTimePicker
:
13
14
15
16
17
18
19
20
21
22
23
00
01
02
03
04
05
06
07
08
09
10
11
12
Disabled BitTimePicker with label
:
13
14
15
16
17
18
19
20
21
22
23
00
01
02
03
04
05
06
07
08
09
10
11
12
Required BitTimePicker
Validation will happen when the
Submit
button is clicked.BitTimePicker allowing text input
The input field will open the BitTimePicker, and clicking the field again will dismiss the BitTimePicker and
allow text input. Please note to use this feature, you must enter the time in the exact
TimeFormat
provided for the BitTimePicker.
:
13
14
15
16
17
18
19
20
21
22
23
00
01
02
03
04
05
06
07
08
09
10
11
12
BitTimePicker with custom time formatting
Applications can customize how times are formatted and parsed. Formatted times can be ambiguous, so the control will avoid parsing the formatted strings of times selected using the UI when text input is allowed.
In this example, we are formatting and parsing times as hh:MM:ss.
:
13
14
15
16
17
18
19
20
21
22
23
00
01
02
03
04
05
06
07
08
09
10
11
12
BitTimePicker with a custom label
In this example, the callout of the BitTimePicker would be opened and closed using an icon button which is customely located in the label.
This functionality has been implemented using a public API provided in the BitTimePicker.
:
13
14
15
16
17
18
19
20
21
22
23
00
01
02
03
04
05
06
07
08
09
10
11
12
BitTimePicker with value two-way binding
:
13
14
15
16
17
18
19
20
21
22
23
00
01
02
03
04
05
06
07
08
09
10
11
12
BitTimePicker with custom left-handed icon

:
13
14
15
16
17
18
19
20
21
22
23
00
01
02
03
04
05
06
07
08
09
10
11
12
BitTimePicker with custom icon name
:
13
14
15
16
17
18
19
20
21
22
23
00
01
02
03
04
05
06
07
08
09
10
11
12
Custom Invalid Error Message
The custom invalid error message will show when an invalid time is entered.
Responsive BitTimePicker
:
13
14
15
16
17
18
19
20
21
22
23
00
01
02
03
04
05
06
07
08
09
10
11
12
Implementation
BitTimePicker parameters
Name |
Type |
Default value |
Description |
---|---|---|---|
Label | string? | null | Label for the TimePicker. |
LabelTemplate | RenderFragment? | null | Used to customize the label for the TimePicker. |
AmPm | bool | false | If true, sets 12 hour selection clock. |
EditMode | BitTimePickerEditMode | BitTimePickerEditMode.Normal | Choose the edition mode. By default, you can edit hours and minutes. |
AllowTextInput | bool | false | Whether the TimePicker allows input a time string directly or not. |
TabIndex | int | 0 | The tabIndex of the TextField. |
Placeholder | string? | null | Placeholder text for the DatePicker. |
IconTemplate | RenderFragment? | null | Custom TimePicker icon template. |
IconLocation | BitIconLocation | BitIconLocation.Right | TimePicker icon location. |
IconName | string | Clock | Optional TimePicker icon. |
IsOpen | bool | false | Whether or not this TimePicker is open. |
CalloutHtmlAttributes | Dictionary<string, object> | new Dictionary<String, Object>() | Capture and render additional attributes in addition to the main callout's parameters. |
PickerAriaLabel | string | Clock | Aria label for time picker popup for screen reader users. |
IsResponsive | bool | false | Enables the responsive mode in small screens. |
OnClick | EventCallback | Callback for when clicking on TimePicker input. | |
OnFocus | EventCallback | Callback for when focus moves into the TimePicker input. | |
OnFocusIn | EventCallback | Callback for when focus moves into the TimePicker input. | |
OnFocusOut | EventCallback | Callback for when clicking on TimePicker input. | |
IsUnderlined | bool | false | Whether or not the Text field of the TimePicker is underlined. |
HasBorder | bool | true | Determines if the TimePicker has a border. |
Culture | CultureInfo | CultureInfo.CurrentUICulture | CultureInfo for the TimePicker. |
TimeFormat | string? | null | The format of the time in the TimePicker like "HH:mm". |
InvalidErrorMessage | string? | null | The custom validation error message for the invalid value. |
OnSelectTime | EventCallback<TimeSpan?> | Callback for when the on selected time changed. | |
AutoClose | bool | false | If AutoClose is set to true and PickerActions are defined, the hour and the minutes can be defined without any action. |
Value | TimeSpan? | null | The value of TimePicker. |
ValueChanged | EventCallback<TimeSpan?> | Callback for when the on time value changed. |
BitInputBase parameters
Name |
Type |
Default value |
Description |
---|---|---|---|
DisplayName | string? | null | Gets or sets the display name for this field. |
InputHtmlAttributes | IReadOnlyDictionary<string, object>? | null | Gets or sets a collection of additional attributes that will be applied to the created element. |
Value | TValue? | null | Gets or sets the value of the input. This should be used with two-way binding. |
BitComponentBase parameters
Name |
Type |
Default value |
Description |
---|---|---|---|
AriaLabel | string? | null | The aria-label of the control for the benefit of screen readers. |
Class | string? | null | Custom CSS class for the root element of the component. |
HtmlAttributes | Dictionary<string, object> | new Dictionary<string, object>() | Capture and render additional attributes in addition to the component's parameters. |
Id | string? | null | Custom id attribute for the root element. if null the UniqueId will be used instead. |
IsEnabled | bool | true | Whether or not the component is enabled. |
Style | string? | null | Custom CSS style for the root element of the component. |
Visibility | BitVisibility | BitVisibility.Visible | Whether the component is visible, hidden or collapsed. |
BitComponentBase public members
Name |
Type |
Default value |
Description |
---|---|---|---|
UniqueId | Guid | Guid.NewGuid() | The readonly unique id of the root element. it will be assigned to a new Guid at component instance construction. |
RootElement | ElementReference | The ElementReference of the root element. |
BitVisibility enum
Name |
Value |
Description |
---|---|---|
Visible | 0 | Show content of the component. |
Hidden | 1 | Hide content of the component,though the space it takes on the page remains. |
Collapsed | 2 | Hide content of the component,though the space it takes on the page gone. |
BitIconLocation enum
Name |
Value |
Description |
---|---|---|
Left | 0 | Show the icon at the left side. |
Right | 1 | Show the icon at the right side. |
BitTimePickerEditMode enum
Name |
Value |
Description |
---|---|---|
Normal | 0 | Can edit hours and minutes. |
OnlyMinutes | 1 | Can edit only minutes. |
OnlyHours | 1 | Can edit only hours. |
BitVisibility enum
Name |
Value |
Description |
---|---|---|
Visible | 0 | The content of the component is visible. |
Hidden | 1 | The content of the component is hidden, but the space it takes on the page remains (visibility:hidden). |
Collapsed | 2 | The component is hidden (display:none). |