Using wierd formats like DDD dd MM yyyy or DD • dd MM yyyy cause datepicker to select a date different to what user has selected when unfocused.
As long as datepicker is focused, everything works ok.
but the date will change when clicked outside the component:
Seems like unfocusing the component triggers processing datepicker value. When you click on the calendar cell, the value it holds is epoch which lets datepicker to process and format the value correctly. When unfocused, the value beeing processed is no longer the epoch value, but it processes the displayValue - in this case it's Thursday • 10 October 2024. Datepicker starts to process displayValue instead of value which causes it to bug.
Funny thing is the vanilla JS Date class is handles this wierd formatting correctly.
>new Date('Thursday • 10 October 2024')Thu Oct 10 2024 00:00:00 GMT+0200
Using wierd formats like
DDD dd MM yyyy
orDD • dd MM yyyy
cause datepicker to select a date different to what user has selected when unfocused.As long as datepicker is focused, everything works ok.
but the date will change when clicked outside the component:
Seems like unfocusing the component triggers processing datepicker value. When you click on the calendar cell, the value it holds is epoch which lets datepicker to process and format the value correctly. When unfocused, the value beeing processed is no longer the epoch value, but it processes the
displayValue
- in this case it'sThursday • 10 October 2024
. Datepicker starts to process displayValue instead of value which causes it to bug.Funny thing is the vanilla JS Date class is handles this wierd formatting correctly.
>new Date('Thursday • 10 October 2024')
Thu Oct 10 2024 00:00:00 GMT+0200