Skip to content

Allow custom date formats for the showDatePicker input mode #97134

Closed
flutter/packages
#12608

Description

@MStadlmeier

Use case

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.

Activity

  1. added
    in triagePresently being triaged by the triage team
    frameworkflutter/packages/flutter repository. See also f: labels.
    c: proposalA detailed proposal for a change to Flutter
    c: new featureNothing broken; request for a new capability
    and removed
    in triagePresently being triaged by the triage team
    on Jan 25, 2022
  2. pedromassango commented on Jul 14, 2022

    @pedromassango
    Member

    This seems to be a duplicate of #83302

  3. pedromassango commented on Jul 14, 2022

    @pedromassango
    Member

    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.

        showDatePicker(
           ....
          dateFormatHandler: (DateTime date) {
            return DateFormat('yyyy-MM-dd').format(date);
          },
         .....
        );
  4. flutter-triage-bot commented on Jan 16, 2025

    @flutter-triage-bot

    This issue is missing a priority label. Please set a priority label when adding the triaged-design label.

  5. added
    triaged-designTriaged by Design Languages team
    P2Important issues not at the top of the work list
    on Jan 22, 2025
  6. added
    packageflutter/packages repository. See also p: labels.
    and removed
    frameworkflutter/packages/flutter repository. See also f: labels.
    on Aug 17, 2026
  7. added a commit that references this issue on Sep 10, 2026
    c437326
  8. github-actions commented on Sep 24, 2026

    @github-actions

    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.

  9. locked as resolved and limited conversation to collaborators on Sep 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work lista: internationalizationSupporting other languages or locales. (aka i18n)c: new featureNothing broken; request for a new capabilityc: proposalA detailed proposal for a change to Flutterf: date/time pickerDate or time picker widgetsp: material_uimaterial_ui package in flutter/packagespackageflutter/packages repository. See also p: labels.team-designOwned by Design Languages teamtriaged-designTriaged by Design Languages team

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions