the below code isn’t working for me. The date switches from 15/5/2012 to 05/15/2012 whenever I try to change it.
<script>
$(document).ready(function(){
$("#date").datepicker({
});
var myDate = new Date();
var month = myDate.getMonth() + 1;
var prettyDate = myDate.getDate() + '/' + month + '/' + myDate.getFullYear();
$("#date").val(prettyDate);
});
</script>
Please specify the date format as ‘dd/m/yyyy’ in the datepicker constructor.