From 4b6ab62ab07ebb55a7cf76c71de9059745bcd8e7 Mon Sep 17 00:00:00 2001 From: ndonkoHenri Date: Tue, 7 Jan 2025 13:43:39 +0100 Subject: [PATCH] fix regression in `DatePicker`: invert first and last dates --- sdk/python/packages/flet/src/flet/core/date_picker.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/sdk/python/packages/flet/src/flet/core/date_picker.py b/sdk/python/packages/flet/src/flet/core/date_picker.py index 577460e46..280cc6588 100644 --- a/sdk/python/packages/flet/src/flet/core/date_picker.py +++ b/sdk/python/packages/flet/src/flet/core/date_picker.py @@ -1,8 +1,7 @@ -from datetime import date, datetime +from datetime import datetime from enum import Enum from typing import Any, Optional, Union -from flet.core.badge import BadgeValue from flet.core.control import Control, OptionalNumber from flet.core.control_event import ControlEvent from flet.core.event_handler import EventHandler @@ -94,8 +93,8 @@ def __init__( self, open: bool = False, value: Optional[DateTimeValue] = None, - first_date: DateTimeValue = datetime(year=2050, month=1, day=1), - last_date: DateTimeValue = datetime(year=1900, month=1, day=1), + first_date: DateTimeValue = datetime(year=1900, month=1, day=1), + last_date: DateTimeValue = datetime(year=2050, month=1, day=1), current_date: DateTimeValue = datetime.now(), keyboard_type: Optional[KeyboardType] = None, date_picker_mode: Optional[DatePickerMode] = None,