$(function() {
var dates = $( "#from, #to" ).datepicker({
defaultDate: "+1w",/*当前时间加一周*/
dateFormat: 'yy-mm-dd',//日期格式
changeMonth: true,
changeYear:true, //可选择年份
numberOfMonths: 1,//设置一次显示几个月
onSelect: function( selectedDate ) {
var option = this.id == "from" ? "minDate" : "maxDate",
instance = $( this ).data( "datepicker" ),
date = $.datepicker.parseDate(
i nstance.settings.dateFormat ||
$.datepicker._defaults.dateFormat,
selectedDate, instance.settings );      //还没搞懂?
dates.not( this ).datepicker( "option", option, date );
}
});
});