拿到本月初日期:
var today = new Date();
var days = date1.getDate()-1;
var beginOfMonth = addDay(date1, -days);
var endDate = formatDate(beginOfMonth,"yyyyMMdd");
var endDate = formatDate(today,"yyyyMMdd");
拿到上个月的日期(上个月的同一天)
var lastMonthDate = new Date(); //上月日期
var days = lastMonthDate.getDate();
lastMonthDate.setDate(days);
lastMonthDate.setMonth(lastMonthDate.getMonth()-1);