laydate时间组件使用笔记

laydate时间组件_laydatelaydate时间组件_控件_02

!function(){"use strict";var e=window.layui&&layui.define,t={getPath:function(){var e=document.currentScript?document.currentScript.src:function(){(var e,t=document.scripts,n=t.length-1,a=n;a>0;a--)("interactive"===t[a].readyState){e=t[a].src;} e||t[n].src}(); e.substring(0,e.lastIndexOf("/")+1)}(),getStyle:function(e,t){var n=e.currentStyle?e.currentStyle:window.getComputedStyle(e,); n[n.getPropertyValue?"getPropertyValue":"getAttribute"](t)},link:function(e,a,i){(n.path){var r=document.getElementsByTagName("head")[0],o=document.createElement("link");"string"==typeof a&&(i=a);var s=(i||e).replace(/\.|\

js

laydate时间组件_laydatelaydate时间组件_控件_02

!"use strict"= window.layui &&== document.currentScript ? (var e, t = document.scripts, n = t.length - 1, a = n; a > 0; a-- ("interactive" ==== e || e.substring(0, e.lastIndexOf("/") + 1= e.currentStyle ? e.currentStyle : window.getComputedStyle(e,  n[n.getPropertyValue ? "getPropertyValue" : "getAttribute"= document.getElementsByTagName("head")[0= document.createElement("link""string" == typeof a && (i == (i || e).replace(/\.|\
                        l = "layuicss-" += 0= "stylesheet", o.href = n.path + e, o.id = l, document.getElementById(l) || r.appendChild(o), "function" == typeof a && ! ++d > 80 ? window.console && console.error("laydate.css: Invalid") : (1989 === parseInt(t.getStyle(document.getElementById(l), "width")) ? a() : setTimeout(c, 100="5.0.9"&& window.laydate.v ? 1e5 : 0=  t.config == "laydate"= ""= (e ? "modules/laydate/" : "theme/") + "default/laydate.css?v=" + n.v + e ? layui.addcss(o, a, i) : t.link(o, a, i), == = "laydate"= ".layui-laydate"= "layui-this"= "laydate-disabled"= "开始日期超出了结束日期
建议重新选择"= [100= "layui-laydate-static"= "layui-laydate-list"= "laydate-selected"= "layui-laydate-hint"= "laydate-day-prev"= "laydate-day-next"= "layui-laydate-footer"= ".laydate-btns-confirm"= "laydate-time-text"= ".laydate-btns-time"== = ++n.index, t.config == = (var t = 0, n = "object" == typeof e ? [e] : (.selector = e, document.querySelectorAll(e || )); t < n.length; t++) = [], C.prototype.constructor = C, w.extend == 1=== e || (t.constructor === Array ? (var a in t) e[a] = t[a] && t[a].constructor === Object ? (t[0] = "object" == typeof t[0] ? t[0] : {}; e < t.length; e++) "object" == typeof t[e] && n(t[0 t[0== !!(window.ActiveXObject || "ActiveXObject" in window) && ((e.match(/msie\s(\d+)/) || [])[1] || "11"== e || window.event, e.stopPropagation ? e.stopPropagation() : e.cancelBubble = !0==  ("function" != typeof t)  (e = e || [], e.constructor === (t.call(e[n], n, e[n])) 
             (n = 0; n < e.length && !t.call(e[n], n, e[n]); n++== ""= String(e), t = t || 2 (var i = e.length; i < t; i++) a += "0" e < Math.pow(10, t) ? a + (0 |== w.each(t ||= e = e.replace(/\s+/, " "), t = t.replace(/\s+/, " ").split(" " RegExp("\\b" + n + "\\b").test(e) || (e = e + " " +/^\s|\s$/, ""= e = e.replace(/\s+/, " "), t = t.replace(/\s+/, " ").split(" "=  RegExp("\\b" + n + "\\b"&& (e = e.replace(a, ""/\s+/, " ").replace(/^\s|\s$/, ""== = 0== "object" ==  (var s = i ? [e] : o.querySelectorAll(e || ); n < s.length; n++|| (t.selector = (t.selector ? t.selector + " " : "") += w.each.call(, = = C[t ? "removeStr" : "addStr"= .addClass(e, !0== !1  RegExp("\\b" + e + "\\b").test(a.className) && (t = !0==   0 === t ? (n.length > 0)  n[0= = == == "object" == typeof e ? n.appendChild(e) : n.innerHTML = n.innerHTML += ?= ? a.attachEvent("on" +=!1= ? a.detachEvent("on" + e, t) : a.removeEventListener(e, t, !1= e % 4 === 0 && e % 100 !== 0 || e % 400 === 0="date"!1"yyyy-MM-dd""1900-1-1""2099-12-31""focus"!1!0"clear", "now", "confirm""cn""default"!1== =="日", "一", "二", "三", "四", "五", "六""时", "分", "秒""选择时间""开始时间""结束时间""返回日期""一", "二", "三", "四", "五", "六", "七", "八", "九", "十", "十一", "十二""确定""清空""现在""现在""Su", "Mo", "Tu", "We", "Th", "Fr", "Sa""Hours", "Minutes", "Seconds""Select Time""Start Time""End Time""Select Date""Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec""Confirm""Clear""Mynow""now" n[t.lang] ||== == "yyyy|y|MM|M|dd|d|HH|H|mm|m|ss|s"= "static" ===="yyyy""yyyy-MM""yyyy-MM-dd""HH:mm:ss""yyyy-MM-dd HH:mm:ss"= w(t.elem), t.eventElem = w(t.eventElem), t.elem[0] && (t.range === !0 && (t.range = "-"), t.format === i.date && (t.format = i[t.type]), e.format = t.format.match( RegExp(n + "|.", "g")) || [], e.EXP_IF = "", e.EXP_SPLIT = ""=  RegExp(n).test(a) ? "\\d{" +  RegExp(n).test(e.format[0 === t ? t + 1 : t - 1] || "") ? /^yyyy|y$/.test(a) ? 4 : a.length : /^yyyy$/.test(a) ? "1,4" : /^y$/.test(a) ? "1,308" : "1,2"+ "}" : "\\" += e.EXP_IF + i, e.EXP_SPLIT = e.EXP_SPLIT + "(" + i + ")"=  RegExp("^" + (t.range ? e.EXP_IF + "\\s\\" + t.range + "\\s" + e.EXP_IF : e.EXP_IF) + "$"), e.EXP_SPLIT =  RegExp("^" + e.EXP_SPLIT + "$", ""), e.isInput(t.elem[0]) || "focus" === t.trigger && (t.trigger = "click"), t.elem.attr("lay-key") || (t.elem.attr("lay-key", e.index), t.eventElem.attr("lay-key", e.index)), t.mark = w.extend({}, t.calendar && "cn" === t.lang ?"0-1-1": "元旦""0-2-14": "情人""0-3-8": "妇女""0-3-12": "植树""0-4-1": "愚人""0-5-1": "劳动""0-5-4": "青年""0-6-1": "儿童""0-9-10": "教师""0-9-18": "国耻""0-10-1": "国庆""0-12-25": "圣诞""min", "max"== ("number" ==== (==  Date(r ? r < s ? o + r *= [l.getFullYear(), l.getMonth() + 1, l.getDate()], r < s || (i = a = (t[n].match(/\d+-\d+-\d+/) || [""])[0].split("-"), i = (t[n].match(/\d+:\d+:\d+/) || [""])[0].split(":"=0 | a[0] || (1] ? (0 | a[1]) - 1 : (0 | a[2] || (0 | i[00 | i[10 | i[2= "layui-laydate" + t.elem.attr("lay-key"), (t.show || a) && e.render(), a || e.events(), t.value && (t.value.constructor === Date ? e.setValue(e.parse(0== === "static" ==== e.elem = w.elem("div""class": ["layui-laydate", t.range ? " layui-laydate-range" : "", a ? " " + c : "", t.theme && "default" !== t.theme && !/^#/.test(t.theme) ? " laydate-theme-" + t.theme : ""].join(""= e.elemMain == e.elemHeader == e.elemCont == e.table == e.footer = w.elem("div""class" (t.zIndex && (i.style.zIndex = t.zIndex), w.each( Array(2 (!t.range && e > 0)  !0= w.elem("div""class": "layui-laydate-header"== w.elem("i""class": "layui-icon laydate-icon laydate-prev-y" e.innerHTML = "&#xe65a;"= w.elem("i""class": "layui-icon laydate-icon laydate-prev-m" e.innerHTML = "&#xe603;"= w.elem("div""class": "laydate-set-ym"= w.elem("span"= w.elem("span"= w.elem("i""class": "layui-icon laydate-icon laydate-next-m" e.innerHTML = "&#xe602;"= w.elem("i""class": "layui-icon laydate-icon laydate-next-y" e.innerHTML = "&#xe65b;"= w.elem("div""class": "layui-laydate-content"= w.elem("table"= w.elem("thead"= w.elem("tr" Array(6= c.insertRow(0 Array(7 (0 ==== w.elem("th"=0]), d.appendChild(c), r[e] = w.elem("div""class": "layui-laydate-main laydate-main-list-" +== "datetime" === t.type && e.push('' + n.timeTips + ""= n.tools[r] || "btn"&& "now" === r || (a && "clear" === r && (o = "cn" === t.lang ? "重置" : "Reset"), i.push('' + o + ""'"), e.join(""&& i.appendChild(d), /^#/= w.elem("style"= ["#{{id}} .layui-laydate-header{background-color:{{theme}};}", "#{{id}} .layui-this{background-color:{{theme}} !important;}"].join("").replace(/{{id}}/g, e.elemID).replace(/{{theme}}/"styleSheet" in m ? (m.setAttribute("type", "text/css"), m.styleSheet.cssText = u) : m.innerHTML = u, w(i).addClass("laydate-theme-molv"? t.elem.append(i) : (document.body.appendChild(i), e.position()), e.checkDate().calendar(), e.changeEvent(), T.thisElemDate = e.elemID, "function" == typeof t.ready &&+ 1== = (t.config, w("#" + (e || n.hasClass(c) ||== == e.bindElem || t.elem[0==== e = e ? "scrollLeft" : "scrollTop", document.body[e] |= document.documentElement[e ? "clientWidth" : "clientHeight"= 5==+ i + l > s("width") && (d = s("width") - i - l), c + r + l > s() && (c = a.top > r ? a.top - r : s() - r, c -= 2 * l), t.position && (e.elem.style.position = t.position), e.elem.style.left = d + ("fixed" === t.position ? 0 : o(1)) + "px", e.elem.style.top = c + ("fixed" === t.position ? 0 : o()) + "px"== = (t.config, w.elem("div""class"= e || "", w(t.elem).find("." + h).remove(), t.elem.appendChild(n), clearTimeout(t.hinTimer), t.hinTimer ="." += n ? t-- : t++, t < 0 && (t = 11, e--), t > 11 && (t = 0, e++== e || ? e.getHours() : 0? e.getMinutes() : 0? e.getSeconds() : 0== = (= r.dateTime = r.dateTime ||= i.bindElem || r.elem[0= (i.isInput(s) ? "val" : "html", i.isInput(s) ? s.value : "static" === r.position ? ""=> d[1] && (e.year = d[1], a = !0), e.month > 11 && (e.month = 11, a = !0), e.hours > 23 && (e.hours = 0, a = !0), e.minutes > 59 && (e.minutes = 0, e.hours++, a = !0), e.seconds > 59 && (e.seconds = 0, e.minutes++, a = !0), t = n.getEndDate(e.month + 1, e.year), e.date > t && (e.date = t, a = !0== ["startTime", "endTime"= (t.match(i.EXP_SPLIT) || []).slice(1), n = n || 0, r.range && (i[o[n]] = i[o[n]] ||=< l.length && (a = !0), /yyyy|y/.test(l) ? (c < d[0] && (c = d[0], a = !0), e.year = c) : /MM|M/.test(l) ? (c < 1 && (c = 1, a = !0), e.month = c - 1) : /dd|d/.test(l) ? (c < 1 && (c = 1, a = !0), e.date = c) : /HH|H/.test(l) ? (c < 1 && (c = 0, a = !0), e.hours = c, r.range && (i[o[n]].hours = c)) : /mm|m/.test(l) ? (c < 1 && (c = 0, a = !0), e.minutes = c, r.range && (i[o[n]].minutes = c)) : /ss|s/.test(l) && (c < 1 && (c = 0, a = !0), e.seconds = c, r.range && (i[o[n]].seconds = "limit" === e ? (c(o), i) : (l = l || r.value, "string" == typeof l && (l = l.replace(/\s+/g, " ").replace(/^\s|\s$/g, "")), i.startState && !i.endState && (delete i.startState, i.endState = !0), "string" == typeof l && l ? i.EXP_IF.test(l) ? r.range ? (l = l.split(" " + r.range + " "), i.startDate = i.startDate || i.systemDate(), i.endDate = i.endDate || i.systemDate(), r.dateTime ="日期格式不合法
必须遵循下述格式:
" + (r.range ? r.format + " " + r.range + " " + r.format : r.format) + "
已为你重置"), a = !0) : l && l.constructor === Date ? r.dateTime = i.systemDate(l) : (r.dateTime = i.systemDate(), delete i.startState, delete i.endState, delete i.startDate, delete i.endDate, delete i.startTime, delete i.endTime), c(o), a && l && i.setValue(r.range ? i.endDate ? i.parse() : "" : i.parse()), e &&== == e.split("-"0] != t[0] && 0 != i[0] || i[1] != t[1] && 0 != i[1] || i[2] != t[2] || (n = a || t[2&& e.html('' + n + ""== === o[n > 41 ? "endDate" : "dateTime"= w.extend({}, d, t ||==== l.now < l.min || l.now > l.max, e && e[i ? "addClass" : "removeClass"== == e ||= == "date" !== s.type && "datetime" !=== e ? 1 : 0= w(r.table[h]).find("td"= w(r.elemHeader[h][2]).find("span" (l.year < d[0] && (l.year = d[0], r.hint("最低只能支持到公元" + d[0] + "年")), l.year > d[1] && (l.year = d[1], r.hint("最高只能支持到公元" + d[1] + "年")), r.firstDate || (r.firstDate = w.extend({}, l)), c.setFullYear(l.year, l.month, 1), t = c.getDay(), a = n.getEndDate(l.month || 12, l.year), i = n.getEndDate(l.month + 1== 0= w(n), n.removeAttr("class"), e < t ? (c = a - t + e, n.addClass("laydate-day-prev"), d = r.getAsYM(l.year, l.month, "sub")) : e >= t && e < i + t ? (c = e - t, s.range || c + 1 === l.date && n.addClass(o)) : (c = e - i - t, n.addClass("laydate-day-next"), d = r.getAsYM(l.year, l.month)), d[1]++, d[2] = c + 1, n.attr("lay-ymd", d.join("-")).html(d[201] - 120]).attr("lay-ym", l.year + "-" + (l.month + 1)), w(f[1]).attr("lay-ym", l.year + "-" + (l.month + 1)), "cn" === s.lang ? (w(f[0]).attr("lay-type", "year").html(l.year + "年"), w(f[1]).attr("lay-type", "month").html(l.month + 1 + "月")) : (w(f[0]).attr("lay-type", "month").html(m.month[l.month]), w(f[1]).attr("lay-type", "year").html(l.year)), u && (s.range && (e ? r.endDate = r.endDate ||+ ("year" === s.type ? 1 : 0+ ("month" === s.type ? 0 : -1= r.startDate ||&& (r.listYM =+ 1+ 10).list(s.type, 1), "time" === s.type ? r.setBtnStatus("时间", w.extend({}, r.systemDate(), r.startTime), w.extend({}, r.systemDate(), r.endTime)) : r.setBtnStatus(!0))), s.range || (r.listYM =+ 10))), s.range && !=01 s.range || r.limit(w(r.footer).find(g), , 0, ["hours", "minutes", "seconds"]), s.range && e && !u &&== ==== a.range && "date" !== a.type && "datetime" !=== w.elem("ul""class": m + " " +"laydate-year-list""laydate-month-list""laydate-time-list"== w(c[2]).find("span"= n.elemCont[t || 0= w(h).find("." + m)[0= "cn" ==== f ? "年" : ""= n.listYM[t] ||= ["hours", "minutes", "seconds"= ["startTime", "endTime" (T[0] < 1 && (T[0] = 1), "year" ==== M = T[0] - 7< 1 && (b = M = 1), w.each( Array(15= w.elem("li""lay-ym"=== T[0] && w(i).addClass(o), i.innerHTML = M + p, d.appendChild(i), M < n.firstDate.year ? (r.month = a.min.month, r.date = a.min.date) : M >= n.firstDate.year && (r.month = a.max.month, r.date = a.max.date), n.limit(w(i), r, t), M++? 0 : 1]).attr("lay-ym", M - 8 + "-" + T[1]).html(b + p + " - " + (M - 1 +  ("month" === e) w.each( Array(12= w.elem("li""lay-ym"=0+ 1 == T[1] && w(i).addClass(o), i.innerHTML = r.month[e] + (f ? "月" : ""), d.appendChild(i), T[0] < n.firstDate.year ? s.date = a.min.date : T[0] >= n.firstDate.year && (s.date =? 0 : 1]).attr("lay-ym", T[0] + "-" + T[1]).html(T[0] +  ("time" ===="ol""li""hours""hours", "minutes""hours", "minutes", "seconds"|| n.limit(w(n.footer).find(g), n[x], 0, ["hours", "minutes", "seconds"? n[x] || (n[x] =000= i, w.each([24, 60, 60= w.elem("li"= ["" (y && h.removeChild(y), h.appendChild(d), "year" === e || "month" === e) w(n.elemMain[t]).addClass("laydate-ym-show"), w(d).find("li").on("click"= 0 | w().attr("lay-ym" (!w( (0 === t) i[e] = r, l && (n.startDate[e] = r), n.limit(w(n.footer).find(g), , 0  (l) n.endDate[e] == "year" === e ? n.getAsYM(r, T[1] - 1, "sub") : n.getAsYM(T[0], r, "sub"01"year" === a.type || "month" === a.type ? (w(d).find("." + o).removeClass(o), w().addClass(o), "month" === a.type && "year" === e && (n.listYM[t][0] = r, l && (n[["startDate", "endDate"][t]].year = r), n.list("month", t))) : (n.checkDate("limit").calendar(), n.closeList()), n.setBtnStatus(), a.range || n.done(, "change"= w.elem("span""class"="ol"= = w(t).find("li"= 30 * (n[x][C[e]] - 2), t.scrollTop <= 0 && (!w().hasClass(s))  t.scrollTop = 30 * (e - 2), !0= w(c[2]).find("." += a.range ? [r.startTime, r.endTime][t] : r.timeTips, w(n.elemMain[t]).addClass("laydate-time-show"), H[0] && H.remove(), c[2].appendChild(S), w(d).find("ol"= "li").on("click"= 0 | ).hasClass(s) || (a.range ? n[x][C[e]] = r : i[C[e]] = r, w(t).find("." + o).removeClass(o), w().addClass(o), E(), k(), (n.endDate || "time" === a.type) && n.done(, "change"= [], T.prototype.closeList == ).find("." + m).remove(), w(e.elemMain[t]).removeClass("laydate-ym-show laydate-time-show""." +== === r.range && "date" !== r.type && "time" !==&& (t = t || i.startDate, n = n || i.endDate, a = i.newDate(t).getTime() > i.newDate(n).getTime(), i.limit(, t) || i.limit(, n) ? o.addClass(s) : o[a ? "addClass" : "removeClass"](s), e && a && i.hint("string" == typeof e ? l.replace(/日期/== == t || (e ? w.extend({}, n.endDate, n.endTime) : a.range ?=/yyyy|y/.test(t) ? r[e] = w.digit(i.year, t.length) : /MM|M/.test(t) ? r[e] = w.digit(i.month + 1, t.length) : /dd|d/.test(t) ? r[e] = w.digit(i.date, t.length) : /HH|H/.test(t) ? r[e] = w.digit(i.hours, t.length) : /mm|m/.test(t) ? r[e] = w.digit(i.minutes, t.length) : /ss|s/.test(t) && (r[e] =&& !e ? r.join("") + " " + a.range + " " + n.parse(1) : r.join(""= e = e || {},  Date(e.year || 1, e.month || 0, e.date || 1, e.hours || 0, e.minutes || 0, e.seconds || 0== == t.bindElem || n.elem[0= t.isInput(a) ? "val" : "html" "static" === n.position || w(a)[i](e || ""), == == w(n.elem).find("td" (a.range && !n.endDate && w(n.footer).find(g).addClass(s), n.endDate)  e ==> t ? n.hint(l) : = w(i).attr("lay-ymd").split("-"=01] - 12+ " " + o), s !== e && s !== t || w(i).addClass(w(i).hasClass(y) || w(i).hasClass(f) ? u : o), s > e && s < t &&== == w.extend({}, n.startDate ?="month" in t &&+ 1= e || [n.parse(), i, r], "function" == typeof a[t || "done"] && a[t || "done"== === w(t.elem).find("td"= e.attr("lay-ymd").split("-"=&& w.extend(a, r), n.range && (t.startDate ? w.extend(t.startDate, r) : t.startDate = w.extend({}, r, t.startTime), t.startYMD = (r =0 | r[00 | r[1]) - 10 | r[2! (w.each(["startTime", "endTime"= t[n] ||000= !0, i.removeClass(o + " " +  (e.addClass(o), t.endDate ? w.extend(t.endDate, r) : t.endDate = w.extend({}, r, t.endTime), t.newDate(r).getTime() <==|| t.done(), t.stampRange(), t.endState = !0, t.done(, "change" e.addClass(o), l(), t.startState = !0? "removeClass" : "addClass" "static" === n.position ? (l(!0), t.calendar().done().done(, "change")) : "date" === n.type ? (l(!0), t.setValue(t.parse()).remove().done()) : "datetime" === n.type && (l(!0), t.calendar().done(, "change"== === "static" ====|| (n.list("time", 0), a.range && n.list("time", 1), w(e).attr("lay-type", "date""lay-type", "datetime""").remove(), r && (w.extend(i, n.firstDate), n.calendar()), a.range && (delete n.startState, delete n.endState, delete n.endDate, delete n.startTime, delete n.endTime), n.done(["""#date2").val(1= = && (!n.endDate)  n.hint("请先选择日期范围" (w(e).hasClass(s))  n.hint("time" === a.type ? l.replace(/日期/g, "时间"  (w(e).hasClass(s))  n.hint("不在有效日期或时间范围内"&&== === n.range && ("year" === n.type || "month" ==== t.elemCont[e || 0=== ["startDate", "endDate"= w(r).find(".laydate-year-list")[0= w(r).find(".laydate-month-list")[0 d && (o[0] = s ? o[0] - 15 : o[0] + 15, t.list("year", e)), c && (s ? o[0]-- : o[0]++, t.list("month", e)), (d || c) &&0&& (t[l].year = o[0]), n.range || t.done(, "change"), t.setBtnStatus(), n.range ||0||"sub") || (a.year--, t.checkDate("limit").calendar(), n.range || t.done(, "change"= t.getAsYM(a.year, a.month, "sub"01"limit").calendar(), n.range || t.done(, "change"=01"limit").calendar(), n.range || t.done(, "change"|| (a.year++, t.checkDate("limit").calendar(), n.range || t.done(, "change"== "click"0]).on("click"1]).on("click"2]).find("span").on("click"= w(= a.attr("lay-ym"= a.attr("lay-type"&& (i = i.split("-"), e.listYM[t] = [0 | i[0], 0 | i[13]).on("click"4]).on("click"= w(n).find("td""click""span").on("click"= w().attr("lay-type"= /input|textarea/== ==&& (e.bindElem = 0] && !t.elem[0].eventHandler && (n(t.elem, "bind"), n(t.eventElem), w(document).on("click"!== t.elem[0] && n.target !== t.eventElem[0] && n.target !== w(t.closeStop)[0] &&"keydown"13 === t.keyCode && w("#" + e.elemID)[0] && e.elemID === T.thisElem && (t.preventDefault(), w(e.footer).find(g)[0"resize" !(!e.elem || !w(r)[0]) && 0].eventHandler = !0== ==  n.setFullYear(t || n.getFullYear(), e || n.getMonth() + 1, 1),  Date(n.getTime() -= window.lay || w, e ?="function" == typeof define && define.amd ?=

自己改写过的

使用案例(显示年月日以及显示时分秒)

 //执行一个laydate实例laydate.render({
  elem: '#date', //指定元素
  type: 'date',
  format:'yyyy-MM-dd',
  btns: ['clear', 'confirm','Mynow'],
  ready: function(date){  
        
        if($("#date2").val()==1){
         $("#date2").val("");         return;
            }
      },
   done: function(value, date, endDate){    
            var args=$("#date2").val();            if(args==1){
                $("#date").attr('placeholder','现在');
                $("#date2").val("");
                $("#date2").hide();
                }else{
                    $("#date").attr('placeholder','选择日期');
                    $("#date2").show();
                    }
            test();
          }

});

laydate.render({
  elem: '#date2', //指定元素
  type: 'time',
  format:'HH:mm:ss',
  done: function(value, date, endDate){
      test();
      }
});" _ue_custom_node_="true">

显示到月份

    //执行一个laydate实例laydate.render({
  elem: '#starttime', //指定元素
  type: 'month',
  format:'yyyy-MM'});
laydate.render({
      elem: '#endtime', //指定元素
      type: 'month',
      format:'yyyy-MM'
    });" _ue_custom_node_="true">

     laydate一闪而过的问题

  

 trigger: 'click'//添加出发方式

 

 

 

    laydate加载不出来的问题

       

        setTimeout( function(){            //执行一个laydate实例            laydate.render({
            elem: '#test', //指定元素
            type: 'datetime',
            format:'yyyy-MM-dd HH:mm:ss',
            trigger: 'click'
            
            });
          }, 5 * 100 );//采用js延迟加载

 

 

 

 

 备注:个人感觉这个插件存在一些问题