Skip to content

Allow custom date formats for the showDatePicker input mode #97134

@MStadlmeier

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.

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 widgetsf: material designflutter/packages/flutter/material repository.frameworkflutter/packages/flutter repository. See also f: 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