Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using unusual date formats cause strange datepicker behavior #40

Open
stooczu opened this issue Jun 10, 2024 · 0 comments
Open

Using unusual date formats cause strange datepicker behavior #40

stooczu opened this issue Jun 10, 2024 · 0 comments

Comments

@stooczu
Copy link

stooczu commented Jun 10, 2024

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.

image

but the date will change when clicked outside the component:

image

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant