//日期自定義時分秒為當前時間
var startTime;
var now = new Date();
function time(obj){
layui.use('laydate', function(){
var laydate = layui.laydate;
startTime= laydate.render({
elem: obj,
type: 'datetime',
format: 'yyyy-MM-dd HH:mm',
theme: 'molv',
ready: function(date){
//可以自定義時分秒
this.dateTime.hours=now.getHours();
this.dateTime.minutes=now.getMinutes();
},
done: function(value, date, endDate){
startTime.config.max = {
year:date.year,
month:date.month-1,
date: date.date,
hours:this.dateTime.hours,
minutes:this.dateTime.minutes
};
}
});
});
}
點擊確定時分秒為當前時間