<div class="layui-form-item"> <label class="layui-form-label">带看日期</label> <div class="layui-input-inline"> <input type="text" name="yuyue_time" class="layui-input" id="yuyue_time" lay-verify="required" placeholder="请选择带看日期" autocomplete="on" > </div> </div>
laydate.render({ //获取当前元素id elem: '#yuyue_time' //点击生效 ,trigger: 'click' //时间与日期控件 ,type: 'datetime' //只能选择今天之后的 ,min:minDate() //颜色 ,theme: '#393D49' //回调时间,返回给页面上 ,done: function(value, date, endDate){ $('#yuyue_time').val(value); } });
function minDate(){ var now = new Date(); return now.getFullYear()+"-" + (now.getMonth()+1) + "-" + now.getDate(); }
来源:oschina
链接:https://my.oschina.net/u/4196676/blog/3191465