DateTimePicker
Introduction
DateTimePicker
is a widget in Supervisely that allows you to choose a date and time on the UI.
Function signature
Parameters
Parameters | Type | Description |
---|---|---|
|
| Default value in |
|
| Allows to set read only mode |
|
| Allows to disable |
|
| Allows to edit input |
|
| Shows clear button |
|
| Size of input field |
|
|
|
|
|
|
|
| Datetime displaying format |
|
| ID of the widget |
value
Determine DateTimePicker
default value.
type: Union[int, str, list, tuple, None]
default value: None
placeholder
Determine DateTimePicker
placeholder.
type: str
default value: "Select date and time"
size
Determine DateTimePicker
size of the input.
type: Literal["large", "small", "mini", None]
default value: None
w_type
Determine DateTimePicker
picker type.
type: Literal["year", "month", "date", "datetime", "week", "datetimerange", "daterange"]
default value: "datetime"
format
Determine DateTimePicker
displaying format.
type: Literal["yyyy", "MM", "dd", "HH", "mm", "ss"]
default value: "yyyy-MM-dd HH:mm:ss"
readonly
Determine whether DateTimePicker
is read-only.
type: bool
default value: False
disabled
Determine whether DateTimePicker
is disabled.
type: bool
default value: False
editable
Determine whether the input is editable.
type: bool
default value: False
clearable
Determine whether to show a clear button.
type: bool
default value: True
widget_id
The ID of the widget
type: str
default value: None
Methods and attributes
Attributes and Methods | Description |
---|---|
| Return |
| Set |
| Decorator function to handle |
Mini App Example
You can find this example in our GitHub repository:
supervisely-ecosystem/ui-widgets-demos/input/006_datetime_picker/src/main.py
Import libraries
Init API client
First, we load environment variables with credentials and init API for communicating with Supervisely Instance:
Initialize DateTimePicker
and Text
widgets
DateTimePicker
and Text
widgetsCreate app layout
Prepare a layout for an app using Card
widget with the content
parameter.
Create an app using a layout
Create an app object with a layout parameter.
Add functions to control widgets from Python code
Last updated