jQuery UI DatePicker - Change Date Format
inside the jQuery script code just paste the code.
$( ".selector" ).datepicker({ dateFormat: 'yy-mm-dd' });
this should work.
Here's one specific for your code:
var date = $('#datepicker').datepicker({ dateFormat: 'dd-mm-yy' }).val();
More general info available here:
- http://api.jqueryui.com/datepicker/#option-dateFormat
- http://api.jqueryui.com/datepicker/#utility-formatDate