Repository navigation
showDatePicker has date format issues when DatePickerEntryMode.input is selected #62401
Copy link
Copy link
Closed
flutter/packages
#12608Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work lista: text inputEntering text in a text field or keyboard related problemsEntering text in a text field or keyboard related problemscustomer: crowdAffects or could affect many people, though not necessarily a specific customer.Affects or could affect many people, though not necessarily a specific customer.f: date/time pickerDate or time picker widgetsDate or time picker widgetsp: material_uimaterial_ui package in flutter/packagesmaterial_ui package in flutter/packagespackageflutter/packages repository. See also p: labels.flutter/packages repository. See also p: labels.team-designOwned by Design Languages teamOwned by Design Languages teamtriaged-designTriaged by Design Languages teamTriaged by Design Languages team
Description
Steps to Reproduce
- Call showDatePicker method and choose edit mode in dialog. (Tested with 'tr' locale)
- Try to change the TextField manually. It changes from dot(.) format to slashes(/). Then when you enter, you get invalid format error. If you delete them all, then you can only enter digits because you don't have control over keyboard.
Expected results:
What I expect from this feature(DatePickerEntryMode.input) is to be able to disable/enable it. If I can't disable it, I want to control it. I want to be able to specify date format, control keyboard etc.
Actual results:
As specified at step 2, when you try to change the TextField manually, It changes from dot(.) format to slashes(/). Then when you enter, you get invalid format error. If you delete them all, then you can only enter digits because you don't have control over keyboard.
Logs
[✓] Flutter (Channel stable, v1.17.5, on Mac OS X 10.15.5 19F101, locale en-TR)
• Flutter version 1.17.5 at /Users/figengungor/Documents/development/flutter
• Framework revision 8af6b2f038 (4 weeks ago), 2020-06-30 12:53:55 -0700
• Engine revision ee76268252
• Dart version 2.8.4
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
• Android SDK at /Users/figengungor/Library/Android/sdk
• Platform android-29, build-tools 29.0.2
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 11.5)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 11.5, Build version 11E608c
• CocoaPods version 1.8.4
[✓] Android Studio (version 4.0)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 47.1.2
• Dart plugin version 193.7361
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
[!] Connected device
! No devices available
! Doctor found issues in 1 category.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work lista: text inputEntering text in a text field or keyboard related problemsEntering text in a text field or keyboard related problemscustomer: crowdAffects or could affect many people, though not necessarily a specific customer.Affects or could affect many people, though not necessarily a specific customer.f: date/time pickerDate or time picker widgetsDate or time picker widgetsp: material_uimaterial_ui package in flutter/packagesmaterial_ui package in flutter/packagespackageflutter/packages repository. See also p: labels.flutter/packages repository. See also p: labels.team-designOwned by Design Languages teamOwned by Design Languages teamtriaged-designTriaged by Design Languages teamTriaged by Design Languages team

Activity
TahaTesser commentedon Jul 28, 2020
hI @figengungor
Just reopened this issue #55535, it would have been fixed but i can reproduce
Please follow up on that issue, I'm closing the current one as a duplicate.
If you disagree, please write in the comments and I will reopen it.
Thank you
figengungor commentedon Aug 26, 2020
Hey @TahaTesser Can you open this issue again, please?
Leaving the reason here: #63372 (comment)
darrenaustin commentedon Aug 27, 2020
I see where the confusion was. There are two related issues here:
I will reopen this bug to address the keyboard issue.
darrenaustin commentedon Aug 27, 2020
It would appear to be a problem with specific devices, as I don't see the problem on an Android Emulator (API 30):
Can you tell us what devices you are seeing this problem on?
darrenaustin commentedon Aug 27, 2020
We are requesting the InputType.TYPE_CLASS_DATETIME keyboard which one would think would include separators needed for entering a date and time for a given locale, but it appears that some devices just show the number entry keyboard.
Couple of possible ways to address this:
Don't specify the type of keyboard and just let the system bring up the default keyboard.
This is a the safest, but leads to a less than great user experience for most users, as most devices bring up a date time keyboard designed for date entry.
Special case certain devices that we know have this issue and just use the default keyboard for those.
This is problematic in that we would be continually tracking these issues. And I think that it may be specific to whatever keyboard IME support the user has set up on their device.
Expose the
keyboardTypeparameter in theshowDatePicker/showDateRangePicker(), andInputDatePickerFormFieldthat would allow apps to override with what ever keyboard request they want.We could do this independent of the the first two. It would allow the apps to override the default, but it would be nice if they didn't have to.
lsarruda commentedon Aug 29, 2020
Hi,
I'm having the same problem, the emulator works correctly, but on my phone the date (/) separator does not appear.
Location pt - BR.
Phone - Samsung Galaxy S20.
darrenaustin commentedon Aug 31, 2020
It certainly looks like this is mostly a problem with Samsung devices. However, given that it is apparently up to the keyboard installed by the user to decide what it wants to show for a
InputType.TYPE_CLASS_DATETIMEkeyboard, it would probably be best to err on the conservative side and go with the full default keyboard for the date pickers and expose thekeyboardTypeas a parameter so that apps can override this if they want.Opinions/feedback on this welcome.
figengungor commentedon Sep 1, 2020
I tested on Lg G5. This feature cannot be used on certain devices so in order to make it functional, the keyboardType can be exposed for now. We can think of better ways to do it later.
21 remaining items
flutter-triage-bot commentedon Nov 11, 2024
This issue is missing a priority label. Please set a priority label when adding the
triaged-designlabel.ashiq-dev-codes commentedon Aug 21, 2025
GitHub Issue / Suggestion: Standardizing showDatePicker Date Format
Problem:
Users can manually type dates in mm/dd/yyyy format while most of the app expects dd/MM/yyyy. This causes parsing errors and inconsistent date formats across the app.
Proposed Solutions:
1. Using Flutter Localization
You can force the date picker to follow a locale that uses dd/MM/yyyy (e.g., UK or India) by using Flutter’s built-in localizations:
✅ Pros: Works with stock showDatePicker.
⚠️ Cons: Requires adding flutter_localizations to pubspec.
2. Using a Custom CalendarDelegate
If you want to avoid adding localization dependencies or handle manual input parsing more flexibly, you can extend GregorianCalendarDelegate and override parseCompactDate:
Usage:
✅ Pros: Full control over manual input parsing, no extra pubspec assets required.
⚠️ Cons: Requires using a picker or widget that supports custom CalendarDelegate.
Recommendation:
[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.