layui时间选择控件时间限定

 let begT = laydate.render({
    elem: '#begintime', 
    type: 'datetime', 
    format: 'yyyy-MM-dd HH:mm', 
    done: function (value, date, endDate) {
        endT.config.min = {
            year: date.year,
            month: date.month - 1,
            date: date.date,
            hours: date.hours,
            minutes: date.minutes+1,
            seconds: date.seconds
        }
    }
});
let endT = laydate.render({
    elem: '#endtime', 
    type: 'datetime', 
    format: 'yyyy-MM-dd HH:mm', 
    done: function (value, date, endDate) {
        begT.config.max = {
            year: date.year,
            month: date.month - 1,
            date: date.date,
            hours: date.hours,
            minutes: date.minutes,
            seconds: date.seconds
        }
    }
});

 

posted @ 2021-02-21 11:25  TenFly  阅读(844)  评论(0编辑  收藏  举报