easyui 获取并设置当前时间

//得到当前日期
formatterDate = function(date,type) {
var day = date.getDate() > 9 ? date.getDate() : "0" + date.getDate();
var month = (date.getMonth() + 1) > 9 ? (date.getMonth() + 1) : "0"
+ (date.getMonth() + 1);

if(type=='start'){
return date.getFullYear() + '-' + month + '-01';
}
if(type=='end'){
return date.getFullYear() + '-' + month + '-' + day;
}


};
//初始化查询条件中的日期
window.onload = function() {
$('#startTime').datebox('setValue', formatterDate(new Date(),"start"));
$('#endTime').datebox('setValue', formatterDate(new Date(),"end"));
};

你可能感兴趣的:(前台)