既是漲知識(shí)的一天,又是干前端的一天!
laydate.render({
? ? ? ? elem: '#validityPeriod',
? ? ? ? //type: 'datetime',//類型要一定要相匹配
? ? ? ? type: 'date', // 設(shè)置日期選擇模式
? ? ? ? trigger: 'click',
? ? ? ? format: 'yyyy-MM-dd HH:mm:ss', // 設(shè)置日期的顯示格式
? ? ? ? min: startDate,
? ? ? ? max: endDate,
? ? ? ? done: function(value, date){ // 監(jiān)聽(tīng)日期選擇完成的事件
? ? ? ? ? ? ?if(value !=null && value!=""){
? ? ? ? ? ? ? ? var defaultValue = value.substr(0,10) + ' 23:59:59'; // 添加默認(rèn)時(shí)間部分
? ? ? ? ? ? ? ? document.getElementById('validityPeriod').value = defaultValue; // 更新輸入框中的內(nèi)容
? ? ? ? ? ? }else{
? ? ? ? ? ? ? ? document.getElementById('validityPeriod').value =value;
? ? ? ? ? ? }
? ? ? ? ? }
? ? ? ?
? ? });
-----------html文章來(lái)源:http://www.zghlxwxcb.cn/news/detail-615669.html
?<input type="text" name="validityPeriod" id="validityPeriod" lay-verify="validityPeriod" required placeholder="yyyy-MM-dd" class="layui-input" style="width: 190px;" autocomplete="off">文章來(lái)源地址http://www.zghlxwxcb.cn/news/detail-615669.html
到了這里,關(guān)于layui 設(shè)置選中時(shí)間為當(dāng)天時(shí)間最大值23:59:59、laydate設(shè)置選中時(shí)間為當(dāng)天時(shí)間最大值23:59:59的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!