• 年检日期:





  • 有限截止日期:




  • layui.use(['laydate'], function(){
    var laydate = layui.laydate;

        var datetime=new Date();//获取系统当前时间
        var datetimeNextYear = new Date(datetime);
        datetimeNextYear.setFullYear(datetime.getFullYear()+1);
        datetimeNextYear.setDate(datetimeNextYear.getDate()-1);
        //日期
        laydate.render({
            elem: '#expirationDate1'
            ,value: datetimeNextYear
            ,format: 'yyyy-MM-dd'
            ,theme: '#128af1'
            ,done: function(value, date, endDate){
                console.log(value)
                var datetimeNextYear = new Date(value);
                datetimeNextYear.setFullYear(datetimeNextYear.getFullYear()-1);
                datetimeNextYear.setDate(datetimeNextYear.getDate()+1);
                laydate.render({
                    elem: '#surveyDate1'
                    ,value: datetimeNextYear
                    ,format: 'yyyy-MM-dd'
                });
            }
        });
        laydate.render({
            elem: '#surveyDate1'
            ,value: new Date(new Date().getTime())
            ,format: 'yyyy-MM-dd'
            ,theme: '#128af1'
            ,done: function(value, date, endDate){
                console.log(value)
                var datetimeNextYear = new Date(value);
                datetimeNextYear.setFullYear(datetimeNextYear.getFullYear()+1);
                datetimeNextYear.setDate(datetimeNextYear.getDate()-1);
                laydate.render({
                    elem: '#expirationDate1'
                    ,value: datetimeNextYear
                    ,format: 'yyyy-MM-dd'
                });
            }
        });
    });