robisim74 / angular-l10n

Angular library to translate texts, dates and numbers
MIT License
380 stars 59 forks source link

possibility to configure PARSE_DATE_STYLE const. Configure full, long,medium,short options #339

Closed hschindler closed 1 year ago

hschindler commented 1 year ago

Is your feature request related to a problem? Please describe. I need to chage the date format for short. I want to use 2-digits for das and month.

Describe the solution you'd like It should be possible to customize the dateStyle

Describe alternatives you've considered

Additional context

robisim74 commented 1 year ago

You can use Intl.DateTimeFormat options, i.e.

<p>{{ today | l10nDate:locale.language:{ day: '2-digit', month: '2-digit', year: 'numeric' } }}</p>

03/07/2023

hschindler commented 1 year ago

Oh, that works. Thanks for your help!