After selecting a date in jqueryUI datepicker, I need to print the date in dd/mm/yy format.
I’ve tried this, but it doesn’t work:
$('#calendar').datepicker({ dateFormat: 'dd/mm/yy', onSelect: function() { console.log( $.datepicker.parseDate('dd/mm/yy', $(this).datepicker("getDate")) ); }} );
How can I made this?
Any help will be apreciated.
Thanks in advance.
Try this
Note the use of the parameters in the onSelect function.
Fiddle here: http://jsfiddle.net/dXaAd/1/