The MaskedTimeField is a field is a text field that allows the user to enter times as numbers and automatically formats them according to a mask when the user leaves the field. The mask is a string that contains the characters that define the format of the time and the field will interpret times based on the mask. The resulting a human-readable string representing the time.
Features (The order is arbitrary):
Parsing and Formatting Times
The field parses and formats times based on the defined mask, ensuring consistency in input and output formats.
Supported Masks
A variety of time formats are supported, which can be tailored to meet specific application requirements.
Value Representation
The value is internally represented as a LocalTime.
When the setText method is used to set the field's value, the component attempts to parse the text as a LocalTime based on the defined mask.
Minimum and Maximum Values
The MaskedTimeField can enforce minimum and maximum allowable date values.
Date Picker Integration
A built-in date picker provides a user-friendly alternative for time selection.
Locale Support
Locale-specific formatting ensures that times are presented in a way that is familiar to the user.
Client-Side Validation
Patterns and validation rules allow for robust client-side validation to ensure valid input.
Custom Values
Entering custom values can be disabled, requiring the user to select a value using the picker.
Restore Method
It is the text that appears when the user hits the restore key (usually ESC) or by calling the restoreValue() method
See #358
The
MaskedTimeField
is a field is a text field that allows the user to enter times as numbers and automatically formats them according to a mask when the user leaves the field. The mask is a string that contains the characters that define the format of the time and the field will interpret times based on the mask. The resulting a human-readable string representing the time.Features (The order is arbitrary):
Parsing and Formatting Times
The field parses and formats times based on the defined mask, ensuring consistency in input and output formats.
Supported Masks
A variety of time formats are supported, which can be tailored to meet specific application requirements.
Value Representation
The value is internally represented as a
LocalTime
.setText
method is used to set the field's value, the component attempts to parse the text as aLocalTime
based on the defined mask.Minimum and Maximum Values
The
MaskedTimeField
can enforce minimum and maximum allowable date values.Date Picker Integration
A built-in date picker provides a user-friendly alternative for time selection.
Locale Support
Locale-specific formatting ensures that times are presented in a way that is familiar to the user.
Client-Side Validation
Patterns and validation rules allow for robust client-side validation to ensure valid input.
Custom Values
Entering custom values can be disabled, requiring the user to select a value using the picker.
Restore Method
It is the text that appears when the user hits the restore key (usually ESC) or by calling the
restoreValue()
method