//获取当前月份
page.getNowFormatDate = function() {
var date = new Date();
var seperator1 = "-";
var year = date.getFullYear();
var month = date.getMonth() + 1;
var strDate = date.getDate();
if (month >= 1 && month <= 9) {
month = "0" + month;
}
if (strDate >= 0 && strDate <= 9) {
strDate = "0" + strDate;
}
var currentdate = year + seperator1 + month + seperator1 + strDate ;
return currentdate;
};
//获取所选月份的第一天
page.getCurrentMonthFirst = function(){
var startdate=new Date($("#datetime").val());
startdate.setDate(1);
return startdate;
};
//获取所选月份的最后一天
page.getCurrentMonthLast = function(){
var endDate = new Date($("#datetime").val());
var month=endDate.getMonth();
var nextMonth=++month;
var nextMonthFirstDay=new Date(endDate.getFullYear(),nextMonth,1);
var oneDay=1000*60*60*24;
return new Date(nextMonthFirstDay-oneDay);
};