airblade / stimulus-datepicker

Stimulus-powered accessible datepicker
https://airblade.github.io/stimulus-datepicker/
MIT License
66 stars 5 forks source link

Custom date format and initializing with existing date #33

Open YANOUSHek opened 1 month ago

YANOUSHek commented 1 month ago

I'm using the datepicker with custom date format (%d-%m-%Y) and I'm having issues when the datepicker is connected to an input that already contains a date inside (i.e. a standard edit form). It looks like this line doesn't really care about the set format and tries copying the value from input field into the dateValue which later breaks the whole controller.

airblade commented 1 month ago

That's weird. Your situation is the same as the Custom Format example on the demo page.

How are you setting the existing date on your edit form?