mi6 / ic-ui-kit

Intelligence Community UI Kit (based on StencilJS)
MIT License
19 stars 22 forks source link

[ic-date-input/picker] Updating dateFormat clears value #2056

Open GCHQ-Developer-530 opened 6 days ago

GCHQ-Developer-530 commented 6 days ago

Summary of the bug

When using the storybook playground, updating the dateFormat clears whatever is currently in the value field. Instead it should just re-arrange the value to fit the new date format

e.g. if someone enters a date in DD/MM/YYYY like 25/06/2024, then the dateFormat changes to YYYY/MM/DD then the value shown in the date input/date picker should be 2024/06/25

🪜 How to reproduce

Tell us the steps to reproduce the problem:

  1. Go to date picker storybook playground
  2. Set value
  3. Update dateFormat
  4. See the error

🧐 Expected behaviour

As mentioned above, the value should be updated to follow the date format.

ad9242 commented 6 days ago

Will need to add a watch on the dateFormat, but even doing this does not seem to update the values in the DD, MM, YYYY inputs