cunningham icon indicating copy to clipboard operation
cunningham copied to clipboard

Date Picker - Make date format configurable

Open jbpenrath opened this issue 2 years ago • 2 comments

Problematic behavior

About Date Picker component, currently the date format is defined according to the browser language. In some cases, Cunningham consumers would like to be able to enforce date format.

Expected behavior

Cunningham consumers should be able to set date format input through a property.

jbpenrath avatar Jun 15 '23 12:06 jbpenrath

@jbpenrath Yes, do we agree that the custom date format should be used only for displaying the date in a particular format?

It is generally recommended to use ISO string format (such as "YYYY-MM-DD") when passing dates to and from components.

lebaudantoine avatar Jun 20 '23 10:06 lebaudantoine

It's natively not supported, I would need to add a custom mapping of date segments to override the existing ones, as this github answer.

Few questions:

  • Would you have some examples of custom date formats?
  • How would be editable a date as 23 janvier 2023? User would need to type a number for the month segment ?

lebaudantoine avatar Jun 20 '23 10:06 lebaudantoine