DateInput¶
A widget to select a calendar date.

Not supported




Not supported
Usage¶
import toga
current_date = toga.DateInput()
Notes¶
- This widget supports years from 1800 to 8999 inclusive.
- Properties that return
datetime.dateobjects can also accept: datetime.datetime: The date portion will be extracted.str: Will be parsed as an ISO8601 format date string (e.g., "2023-12-25").- On iOS, style directives for changing the widget's color and background color will be ignored. Apple advises against customizing the look and feel of date pickers; as a result, they don't expose APIs to change the color of date widgets.
Reference¶
toga.DateInput ¶
DateInput(
id=None,
style=None,
value=None,
min=None,
max=None,
on_change=None,
**kwargs,
)
Bases: Widget
Create a new DateInput widget.
| PARAMETER | DESCRIPTION |
|---|---|
id
|
The ID for the widget.
TYPE:
|
style
|
A style object. If no style is provided, a default style will be applied to the widget.
TYPE:
|
value
|
The initial date to display. If not specified, the current date will be used.
TYPE:
|
min
|
The earliest date (inclusive) that can be selected.
TYPE:
|
max
|
The latest date (inclusive) that can be selected.
TYPE:
|
on_change
|
A handler that will be invoked when the value changes.
TYPE:
|
kwargs
|
Initial style properties.
DEFAULT:
|