(1)分析源码可知,我们需要返回一个包含我们所需的时间范围的对象(见wafBizCommonquery.js的_getDateFilter方法)。
(2)具体代码:
cusDateConverterExt:function(dateExp){
if (dateExp == 'qst') {
var today = new Date();
var day = today.getDay();
var month = today.getMonth();
var year = today.getFullYear();
var beginTime = new Date(year, month, today.getDate() - 3);
var endTime = today;
var converter = new Object();
converter.beginTime = beginTime;
converter.endTime = endTime;
return converter;
}
}
(3)效果图