You could use the inbuilt validation feature on the datepicker
$(function() {
$( "#datepicker" ).datepicker({ minDate: -1D, maxDate: "+1D" });
});
or if you need to validate after the selection, simply use basic javascript functions to check the date manually after hooking to the datepicker's after selection event.