You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Allow custom date formats for the showDatePicker input mode #97134
I am trying to get the text-based date input in the showDatePicker dialog to be based on specific date format (in my case DD/MM/YY). Currently, showDatePicker only takes a Locale parameter, which means that I am stuck with the choices that the available locales offer me. To my knowledge, there is no locale which would fit my use-case. As a result, I now display the date in DD/MM/YY everywhere except in the text-based input entry mode of the date-picker where my locale dictates MM/DD/YYYY, which is obviously not ideal.
Proposal
The showDatePicker method should take an optional parameter dateFormat which directly controls how the date may be entered when the user switches to DatePickerEntryMode.input. This format should override the locale's setting if necessary.
The showDatePicker method should take an optional parameter dateFormat which directly controls how the date may be entered when the user switches to DatePickerEntryMode.input. This format should override the locale's setting if necessary.
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 selected DateTime and expecting a String in return.
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 -v and a minimal reproduction of the issue.
Activity
pedromassango commentedon Jul 14, 2022
This seems to be a duplicate of #83302
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.flutter-triage-bot commentedon Jan 16, 2025
This issue is missing a priority label. Please set a priority label when adding the
triaged-designlabel.[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.