I am using following code to format date and show 2 months in calendar...
<script>
$(function() {
var dates = $( "#from, #to" ).datepicker({
showOn: "button",
buttonImage: "imgs/calendar-month.png",
buttonImageOnly: true,
defaultDate: "+1w",
changeMonth: true,
numberOfMonths: 2,
onSelect: function( selectedDate ) {
$( ".selector" ).datepicker({ defaultDate: +7 });
var option = this.id == "from" ? "minDate" : "maxDate",
instance = $( this ).data( "datepicker" ),
date = $.datepicker.parseDate(
instance.settings.dateFormat ||
$.datepicker._defaults.dateFormat,
selectedDate, instance.settings );
dates.not( this ).datepicker( "option", "dateFormat", 'yy-mm-dd' );
}
});
});
</script>
The problem is I am not sure how to restrict previous dates selection.