日期控件,layui


<link rel="stylesheet" href="<%=path%>/layui/css/layui.css"
    type="text/css"></link>
<script type="text/javascript" src="<%=path%>/layui/layui.js"></script>
<script>
    layui.use('laydate', function() {
        var laydate = layui.laydate;

        var start = {
            min : laydate.now(),
            max : '2099-06-16 23:59:59',
            istoday : false,
            choose : function(datas) {
                end.min = datas; //开始日选好后,重置结束日的最小日期
                end.start = datas; //将结束日的初始值设定为开始日
            }
        };

        var end = {
            min : laydate.now(),
            max : '2099-06-16 23:59:59',
            istoday : false,
            choose : function(datas) {
                start.max = datas; //结束日选好后,重置开始日的最大日期
            }
        };

        document.getElementById('LAY_demorange_s').onclick = function() {
            start.elem = this;
            laydate(start);
        }
        document.getElementById('LAY_demorange_e').onclick = function() {
            end.elem = this
            laydate(end);
        }

    });
</script>
</head>
<body>
    <p>
        入职时间:<input placeholder="入职时间"
            onclick="layui.laydate({elem: this, festival: true})"
            name="entrydate" />
    </p>
</body>

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM