之前日期过滤组件是年月过滤,现在日期过滤组件换成年月日过滤了,脚本就不起作用了,希望有大神可以指点下脚本怎么修改,之前脚本如下:// 取日期过滤组件开始时间
var startYear = substring(日期过滤2.firstDates[0,1,5)
var startMonth = substring(日期过滤2.firstDates[0,6,len(日期过滤2.firstDates[0))
// 每月第一天
var startDay = 1
param["首次下单-开始-a" = new Date(startYear,startMonth,startDay)
// 取日期过滤组件结束时间
var endYear = substring(日期过滤2.secondDates[0,1,5)
var endMonth = substring(日期过滤2.secondDates[0,6,len(日期过滤2.secondDates[0))
endMonth = parseInt(parseInt(endMonth)+1)
param["首次下单-结束-a" = new Date(getCurrentMonthLastDay(new Date(endYear+"/"+endMonth+"/"+1)))
// 获取当前月份的最后一天,参数为日期
function getCurrentMonthLastDay(date) {
var currentMonth = date.getMonth();
var nextMonth = ++currentMonth;
var nextMonthFirstDay = new Date(date.getFullYear(), nextMonth, 1);
var oneDay = 1000 * 60 * 60 * 24;
var lastTime = new Date(nextMonthFirstDay - oneDay);
var month = parseInt(lastTime.getMonth() + 1);
var day = lastTime.getDate();
if (month < 10) {
month = '0' + month
}
if (day < 10) {
day = '0' + day
}
return date.getFullYear() + '/' + month + '/' + day;
}
|