DatePicker
A Fluent date picker: a field showing the month, day and year, which opens scrolling lists to pick each of them.
Example:
fluent.DatePicker(header="Birthday", value=date(1990, 4, 12))

Inherits: LayoutControl
Properties
autofocus- Whether this picker should be focused on initial display.first_date- The earliest date that can be picked.header- A label shown above the field.last_date- The latest date that can be picked.show_day- Whether the field shows the day.show_month- Whether the field shows the month.show_year- Whether the field shows the year.value- The selected date.
Events
on_change- Called when the user picks a date and confirms it.
Example
Fluent DatePicker
from datetime import date
import flet_fluent_ui as fluent
import flet as ft
def main(page: ft.Page):
page.title = "Fluent DatePicker"
def handle_change(e: ft.Event[fluent.DatePicker]):
# A picked date arrives in UTC: convert it to the local date.
day = e.control.value.astimezone()
status.value = f"Birthday: {day:%B} {day.day}, {day.year}"
status = ft.Text("Birthday: April 12, 1990")
page.add(
ft.SafeArea(
content=ft.Column(
controls=[
fluent.DatePicker(
key="birthday",
header="Birthday",
value=date(1990, 4, 12),
on_change=handle_change,
),
status,
],
)
)
)
if __name__ == "__main__":
ft.run(main)

Properties
autofocusclass-attributeinstance-attribute
autofocus: bool = FalseWhether this picker should be focused on initial display.
first_dateclass-attributeinstance-attribute
first_date: DateTimeValue | None = NoneThe earliest date that can be picked.
If None, it is 100 years before today.
last_dateclass-attributeinstance-attribute
last_date: DateTimeValue | None = NoneThe latest date that can be picked.
If None, it is 25 years after today.
show_monthclass-attributeinstance-attribute
show_month: bool = TrueWhether the field shows the month.
valueclass-attributeinstance-attribute
value: DateTimeValue | None = NoneThe selected date.
If None, the field shows placeholders and the lists open at today's
date.
After the user picks a date, it holds a datetime in UTC for midnight
local time: use value.astimezone() to get the local date.
Events
on_changeclass-attributeinstance-attribute
on_change: ControlEventHandler[DatePicker] | None = NoneCalled when the user picks a date and confirms it.
value holds the new date.