• layui 时间控件 单击 年直接赋值


    //选中
    lay(ul).find('li').on('click', function(){  //结尾处添加

            if (options.done === "year") {
            that.setValue(that.parse()).remove();   
            }
    <script src="laydate/laydate.js"></script> <!-- 改成你的路径 -->
    <script>
    
    
    //年选择器
    laydate.render({
        elem: '#test1'
      , type: 'year'
      , done: "year"
    });

     修改压缩版位置

    w(n.footer).find(D).removeClass(s);
                    if (a.done === "month" && (ym + "").length < 4) { n.setValue(n.parse()).remove() } if (a.done === "year") { n.setValue(n.parse()).remove() };}

    laydate赋值

            laydate.render({
                    elem: '#test1'
                    //, format: 'yyyy-MM-dd' //可任意组合,
                    //, value: new Date(document.getElementById('test1').value) //必须遵循format参数设定的格式
                     , value: getdate('@Model.AResumeWorkTime')
                });
            function getdate(str) {
                if (str && str.length>0)
                {
                    return new Date(str) //必须遵循format参数设定的格式
                }
                return "";
            }
  • 相关阅读:
    GenericServlet vs HttpServlet
    il c井
    额。。万恶之源就是c
    js算数优先级
    connect-flash 中间件
    触发bfd 的条件
    module 和 module.exports 的区别
    a标签填充父容器
    bootstrap
    每日一练排版
  • 原文地址:https://www.cnblogs.com/enych/p/9208469.html
Copyright © 2020-2023  润新知