Time plug it, I used to use the My97DatePicker, the effect is as
Recent use the jeDate, as shown in
This plug-in also step on the record about pit ~ ~ ~
1. Select the time, select the time again, time will be reset for today
Find getCurrValue method jedate.js in, add code
var mats = jet.reMatch(that.format), isEmpty = that.getValue() != "", curVal = [],parmat = that.dlen == 7 ? "hh:mm:ss" : "YYYY-MM" + (that.dlen <= 2 ? "" : "-DD"); //修改Begin(Important!) var result = that.valCell.value; result = result.substr(0, 11); var nowTime = [jet.parse(jet.getDateTime({}), parmat)]; nowTime = nowTime[0]; var time1 = new Date(result).setHours('0'); var time2 = new Date(nowTime).setHours('0'); was nDays = (parseInt ((time1 - TIME2) / 1000/3600/24)); DD: nDays var showed = { }; //修改End that.selectValue = [jet.parse(jet.getDateTime(redate), parmat)];
2. is not a pit, the start time to end time minimum time
(Incidentally, the initial value is set at the time)
// page load initialization var InitPageData = function () { jeDate ( '#text_btime', linkageBeginDate); // initialize start time jeDate ( '# text_etime', linkageEndDate); // initialize end time } // Start Time function linkageBeginDate ( ) { $ ( .. "#text_btime") Val (timeFormat () Split ( "") [0] + "00:00:00" ); return { Theme: {bgcolor: "# 4aa5ff", pnColor: "# 00DDAA " }, the format: 'YYYY-the mM-DD HH: mm: SS', // format minDate: '1971-01-01 00:00:00',// set the minimum date the onClose: to false , value: "1971-01-01 00:00:00" , the maxDate: function (that) { // that points to the object instance var nowMaxDate = "" jeDate.nowDate ({DD: 0}):? $ ( '#text_etime' ) .val (); return nowMaxDate }, // set the maximum date to the current date donefun: function (obj) { jeDate ( "#text_etime", linkageEndDate ( to false )); } }; } // end time function linkageEndDate (the ISTG) { $ ("#text_etime").val(timeFormat().split(" ")[0] + " 23:59:59"); return { trigger: istg || "click", theme: { bgcolor: "#4aa5ff", pnColor: "#00DDAA" }, format: 'YYYY-MM-DD hh:mm:ss', onClose: false, isinitVal: true, minDate: function (that) { var nowMinDate = "" ? jeDate.nowDate({ DD: 0 }) : $('#text_btime').val(); return nowMinDate; },Set the minimum date to the current date// the maxDate: jeDate.nowDate ({DD: 0}), // set the maximum date to the current date }; } // formatting time function timeFormat () { var dateTmp = new new a Date () a toJSON ();. return new new a Date (+ new new a Date (dateTmp) + 3600 * 1000 *. 8) .toISOString (). Replace (/ T / G, '') .replace (/ \. [\ D] {}. 3 the Z /, '' ) }