I am invoking the datepicker on an input box. However, irrespective of the format I am giving, it always returns the date in mm/dd/yyyy format. I want it to return - 30-11-2011 (dd-mm-yyyy) format. Below are the options I tried -
Option 1
$("#birthdate").datepicker({
changeYear: true,
changeMonth: true
dateFormat: 'yy-mm-dd'
});
Option 2
$.datepicker.formatDate('yy-mm-dd', new Date(2007, 1 - 1, 26));
My html includes jquery-ui.js, jquery-ui-datepicker.js and jquery.js.
I have already referred to jQuery UI DatePicker - Change Date Format and Jquery datepicker format date not working and tried all the option but none of them in working for me. Please let me know if someone knows the solution.