Repository navigation
Support providing DateFormat for showDatePicker and showDateRangePicker #83302
Description
Use case
When entering a Date in input mode rather than calendar mode, applications are unable to specify a format to parse other than en_US. This can be seen here. This results in applications being forced to use the default en_US parsing of the input text even when that is not the DateFormat.
The date_range_form_field package wraps the showDateRangePicker function into a FormField widget. It displays the selected date in a DateFormat specified by the application. However, as stated above, in the showDateRangePicker, the input format will always be en_US, regardless of the DateFormat being used in the date_range_form_field package or elsewhere in the app. In order for date_range_form_field to do the right thing, it needs to have a change in showDateRangePicker. For consistency, showDatePicker should be updated as well.
Proposal
Add an optional DateFormat parameter to showDatePicker and showDateRangePicker to specify what DateFormat should be displayed and parsed.
Activity
pedromassango commentedon Jul 14, 2022
Since there is no proper class to represent
DateFormats in Flutter (DateFormat is from packages:intl), we can mitigate this by introducing a callback providing the selectedDateTimeand expecting aStringin return.cc @darrenaustin
ebabhi commentedon Jun 13, 2024
one way to achieve this is to create own localization and pass the desired date format
now override the localization in desire location
flutter-triage-bot commentedon Jun 13, 2024
This issue is missing a priority label. Please set a priority label when adding the
triaged-designlabel.ivictoruan commentedon Jul 17, 2025
Whats happens here? Someone knows how to add DateFormat in this function?
pedromassango commentedon Jul 17, 2025
@goderbauer any chance my proposal in #83302 (comment) could be accepted?
rickdroio commentedon Aug 21, 2025
Dears, any forecast to improve this feature?
[material_ui] Support custom date input formatters via CalendarDelega…
github-actions commentedon Sep 24, 2026
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.