dart-lang / i18n

A general mono-repo for Dart i18n and l10n packages.
BSD 3-Clause "New" or "Revised" License
63 stars 36 forks source link

Add support for yMMdd dateformat #803

Closed aanelson closed 8 months ago

aanelson commented 8 months ago

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

Sometimes dates need a leading zero in the day/month field and the only way to do this is with a custom DateFormat. For example final dateFormat = DateFormat('MM/dd/yyyy', locale.toLanguageTag());

However, localization does not work correctly if you use a custom date format.

Describe the solution you'd like

Add DateFormat.yMMdd() Add add_MM() and add_dd() methods.

Describe alternatives you've considered

static extension on DateFormat for yMMdd, however would have to handle locale mapping.

mosuem commented 8 months ago

While yMd exists in the CLDR data, yMMd does not. So this is not a pattern this package can support.