• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
cnsdhzzl
博客园    首页    新随笔    联系   管理    订阅  订阅
日期控件,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>

 

posted on 2016-12-06 16:11  cnsdhzzl  阅读(2563)  评论(0)    收藏  举报
刷新页面返回顶部
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3