You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
DS7/DSWeb/Areas/RptMng/Viewsjs/MsCheckDate.js

18 lines
587 B
JavaScript

3 years ago
Ext.namespace('DsTruckRpt');
DsTruckRpt.MsCheckDate = function (mydate) {
var e = Ext.Date.parse(mydate, 'Y-m-d'); //格式化日期控件值
var end = new Date(e);
var start = new Date();
var elapsed = Math.round((end.getTime() - start.getTime())/(86400000)); // 计算间隔月数
// 得到系统日期
if (elapsed <= 30) {
return 'check_red';
}
else if (elapsed <= 60) {
return 'check_orange';
}
return '';
}