I am using the UI DatePicker from jQuery UI as the stand alone picker. I have this code:
And the
The getDate method of datepicker returns a date type, not a string.
You need to format the returned value to a string using your date format.
Use datepicker's formatDate
function:
var dateTypeVar = $('#datepicker').datepicker('getDate');
$.datepicker.formatDate('dd-mm-yy', dateTypeVar);
The full list of format specifiers is available here.