zoukankan      html  css  js  c++  java
  • layui中时间插件laydate的使用

    1.加载layui.js

    2.html部分

    <div class="layui-inline">
    <label class="layui-form-label">选择时间</label>
    <div class="layui-inline">
    <div class="layui-input-inline">
    <input type="text" name="start_time" class="layui-input" id="start_time"
    placeholder="开始时间">
    </div>
    </div>-
    <div class="layui-inline">
    <div class="layui-input-inline">
    <input type="text" name="end_time" class="layui-input" id="end_time"
    placeholder="结束时间">
    </div>
    </div>
    </div>

    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(感谢分享)
  • 相关阅读:
    Java反射
    安装python
    查看网页加载速度,并优化
    模型按一个圈摆放(10等分)
    y = n*x 匀速,变速运动
    物体绕圆形做圆周运动
    three.js 相机跟随鼠标移动
    three.js 物体随鼠标移动
    three.js 画正多边形-线性
    ES6的JavaScript数据结构实现之队列
  • 原文地址:https://www.cnblogs.com/luqiang213917/p/11871518.html
Copyright © 2011-2022 走看看