I'm having some issues with datepicker in jQuery.
I'm trying to put the today date in a field which is a datepicker.
I've tried with:
$('#fecha_alta').datepicker('setDate', new Date());
console.log($('#fecha_alta').datepicker('getDate'));
And
$('#fecha_alta').datepicker('setDate', '+0');
console.log($('#fecha_alta').datepicker('getDate'));
But always log null and also the input shows empty.
What's wrong?
Copyright Notice:Content Author:「Antonio Laguna」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/7273225/jquery-ui-datepicker-setdate-method-not-working