Skip to content

[REQ] [Dart2] Allow specifying Locale or DateFormat  #18381

@evanholt1

Description

@evanholt1

Is your feature request related to a problem? Please describe.

currently, the api.dart file generates the dateformatter as : final _dateFormatter = DateFormat('yyyy-MM-dd');

This is causing an issue in my app as I need to specify a fixed locale value for the DateFormat() constructor.

This is because the _dateFormatter formats dates according to the current app locale,
which can generate some unicode string dates which the server & the integrations do not accept;
They only accept english formatted dates.

Describe the solution you'd like

the ability to pass the locale to the constructor.

Describe alternatives you've considered

the ability to change the value of _dateFormatter (being var).
this seems to have been a point of discussion earlier, at #6389 (comment)

Additional context

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions