Skip to main content

Time Input

Allows selection of a specific time.

Examples

Basic Example

The following example demonstrate some of the available functionality for read_time

from abstra.forms import read_time

ans = read_time("Select a time below")
# ans = 00:00:00

Parameters

NameDescriptionType
labelThe label to display to the userstr
initial_valueThe initial value to display to the user. Defaults to "00:00".str or datetime.time
formatWhether the input is in the format 24hs or AM/PM. Defaults to "24hs".str
disabledwhether the input is disabled. Defaults to False.bool
requiredWhether the input is required or not eg. "this field is required". Defaults to True.Union[bool, str]
hintA tooltip displayed to the user. Defaults to None.str
full_widthWhether the input should use full screen width. Defaults to False.bool
button_textWhat text to display on the button when the widget is not part of a Page. Defaults to 'Next'.str

Return Values

TypeDescription
datetime.timeA datetime.time object representing the value entered by the user