To have a working datepicker on a field, I have to put this script inside my element
$( function() {
$( "#date_datepicker" ).datepicker( { dateFormat: "yy-mm-dd" } );
});
Removing the $( function() { makes the datepicker not work.
So does it mean that the $( function() { is the same as $(document).ready?
I'm trying to optimize my javascript codes so knowing this might help.