1.加载layui.js
2.html部分
3.js部分
layui.use([ 'laydate'], function(){
var $ = layui.$;
var laydate = layui.laydate;
var nowTime = new Date().valueOf();
var start = laydate.render({
elem: '#start_time',
type: 'datetime',
max: nowTime,
btns: ['clear', 'confirm'],
done: function(value, date){
endMax = end.config.max;
end.config.min = date;
end.config.min.month = date.month -1;
}
});
var end = laydate.render({
elem: '#end_time',
type: 'datetime',
max: nowTime,
done: function(value, date){
start.config.max = date;
start.config.max.month = date.month -1;
}
})
})
原文链接:https://blog.csdn.net/qq_21178933/article/details/78581206(感谢分享)
手机扫一扫
移动阅读更方便
你可能感兴趣的文章