green icon indicating copy to clipboard operation
green copied to clipboard

Datepicker: Paste format conversion

Open splashdust opened this issue 2 years ago • 0 comments

Currently, the Datepicker only runs pasted strings through the javascript Date() constructor. This can be a problem if the format of the Datepicker is set to something non-standard. That can cause dates copied from a Datepicker to not be pastable in an other instance of the component, for example.

The Datepicker should therefore support parsing that matching the configured formatting of the component. For example, if the dateformat attribute is set to d/m/y, a pasted string like 05/03/2024 should be properly parsed as 2024-03-05

Additionally, it could be useful to support a callback function so that support for custom formats can be added on the consuming side.

splashdust avatar Feb 26 '24 14:02 splashdust