Skip to content

Support providing DateFormat for showDatePicker and showDateRangePicker #83302

@Cali0707

Description

@Cali0707

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.

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