DatePicker
Introduction
DatePicker
widget in Supervsely is a user-friendly and customizable date input solution for Supervisely app developers. It features an intuitive interface that allows users to select a date from a calendar or enter one manually. The widget supports a wide range of date formats, making it suitable for use in diverse applications. With its flexible styling options, the DatePicker component can seamlessly integrate with apps and enhance the user experience.
Function signature
Parameters
Parameters | Type | Description |
---|---|---|
|
| Default value to date picker |
|
| Date picker input help text |
|
| Date picker type |
|
| Determine widget size. |
|
| Specifies that a date picker input should be read-only |
|
| Disable widget |
|
| Allows to edit date picker input value text |
|
| Allows to delete value by clicking |
|
| Determine first day of the week |
|
| Determine value displaying format |
|
| ID of the widget |
value
Default value to date picker
type: Union[int, str, list, tuple]
default value: None
placeholder
Date picker input help text
type: str
default value: Select date"
picker_type
Date picker type
type: Literal["year", "month", "date", "datetime", "week", "datetimerange", "daterange"]
default value: "date"
size
Determine widget size
type: Literal["large", "small", "mini", None]
default value: None
readonly
Specifies that a date picker input should be read-only
type: bool
default value: False
disabled
Disable widget
type: bool
default value: False
editable
Allows to edit date picker input value text
type: bool
default value: True
clearable
Allows to delete value by clicking
type: bool
default value: True
format
Determine value displaying format
type: str
default value: "yyyy-MM-dd"
first_day_of_week
Determine first day of the week
type: int
default value: 1
widget_id
ID of the widget
type: str
default value: None
Methods and attributes
Attributes and Methods | Description |
---|---|
| Get date picker datetime string value |
| Set date picker value |
| Set date range picker values |
| Clear date picker value |
| Decorator function is handled when date picker value is changed value |
Mini App Example
You can find this example in our Github repository:
supervisely-ecosystem/ui-widgets-demos/input/005_date_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 DatePicker
widgets
DatePicker
widgetsCreate Button
, Text
widgets we will use in UI for demo
Button
, Text
widgets we will use in UI for demoCreate app layout
Prepare a layout for app using Card
widget with the content
parameter and place widget that we've just created in the Container
widget.
Create app using layout
Create an app object with layout parameter.
Add functions to control widgets from code
Last updated