easyui-datebox 和easyui-datetimebox 设置默认时间当前时间

//显示当前日期
formatterDate = function (date) {
var day = date.getDate() > 9 ? date.getDate() : "0" + date.getDate();
var month = (date.getMonth() + 1) > 9 ? (date.getMonth() + 1) : "0"
+ (date.getMonth() + 1);
var hor = date.getHours();
var min = date.getMinutes();
var sec = date.getSeconds();
return date.getFullYear() + '-' + month + '-' + day+" "+hor+":"+min+":"+sec;
};

$('#startTime1').datetimebox('setValue', formatterDate(new Date()));

//前端

<div id="startTime1" class="easyui-datetimebox"></div>

posted @ 2016-07-28 11:45  恋之呓  阅读(25012)  评论(1编辑  收藏  举报