Thanks Ray. I've changed it as follows and now the dates display correctly, however when I search it comes up with zero results even though there are definitely matching records:
<script>
$( function() {
var dateFormat = "dd/mm/yy",
from = $( "#DatePaid" )
.datepicker({
dateFormat: "dd/mm/yy",
defaultDate: "-1w",
changeMonth: true,
changeYear: true,
numberOfMonths: 1
})
.on( "change", function() {
to.datepicker( "option", "minDate", getDate( this ) );
}),
to = $( "#DatePaidTo" ).datepicker({
dateFormat: "dd/mm/yy",
defaultDate: "",
changeMonth: true,
changeYear: true,
numberOfMonths: 1
})
.on( "change", function() {
from.datepicker( "option", "maxDate", getDate( this ) );
});
function getDate( element ) {
var date;
try {
date = $.datepicker.parseDate( dateFormat, element.value );
} catch( error ) {
date = null;
}
return date;
}
} );
</script>