//设置日期控件
$("#startdate,#enddate").datepicker({
changeMonth : true,
changeYear : true,
dateFormat : 'yy-mm-dd',
yearRange : "-100:+50",
showButtonPanel:true
}).attr("readonly","readonly");
//设置默认日期为当月1号
var date = new Date();
date.setDate(1);
var month = parseInt(date.getMonth() + 1);
var day = date.getDate();
if (month < 10) month = '0' + month;
if (day < 10) day = '0' + day;
var startTime = date.getFullYear() + '-' + month + '-' + day;
$("#startdate").datepicker('setDate', startTime);
//设置默认日期为当前时间
$("#enddate").datepicker('setDate', new Date());