Dynamically added input field don't inherit the the date picker functionality

I have a form that users can dynamically add sections and one of the fields in these sections is a date picker that uses Flatpickr for the date picker functionality. The issue is the date picker doesn’t work on the newly added field but works on the fields that have been added previously.
So I guess in other words once you add a section which will cause the view to render the date picker doesn’t work but when you add the date manually and persist the data in the DB and refresh the page the date picker will work for the same field.
not sure what is causing this but for some reason the javascript that is in charge of declaring the input field as the date picker doesn’t pick up the dynamically added field.