airblade/stimulus-datepicker

Custom date format and initializing with existing date

Opened this issue · 1 comments

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.

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?