//判断结束时间一定要大于开始时间 function comparativeTime(){ var isok=true; //早餐配送时间 var breakfastScanTimeMin = $("#breakfastScanTimeMin").val(); var breakfastScanTimeMax = $("#breakfastScanTimeMax").val(); //早餐订餐时间 var breakfastBookTimeMin = $("
1.获取系统当前时间 getNowTime(tempminit) { if (!tempminit) { tempminit = 0; } var date = new Date(); date.setMinutes(date.getMinutes() - tempminit); var year = date.getFullYear(), month = date.getMonth() + 1, day = date.getDate(), hour = date.getHours() < 10
// yyyy-MM-dd function bigThanToday(someDate){ var date = new Date(); var dateStr = date.getFullYear()+"-"+fillZero(date.getMonth()+1)+"-"+fillZero(date.getDate()); return someDate > dateStr; } function fillZero(num){ if(num.toStrin
//判断时间是否过期 function judgeTime(time){ var strtime = time.replace("/-/g", "/");//时间转换 //时间 var date1=new Date(strtime); //现在时间 var date2=new Date(); //判断时间是否过期 return date1<date2?true:false; }
replace(/\-/g, "\/")是根据验证表达式把日期转化成长日期格式 function checkStartTimeAndEndTime(startTime, endTime) { var sTime = new Date(startTime.replace("/\-/g", "\/")); var eTime = new Date(endTime.replace("/\-/g", "\/"));
// 判断时间是否超过了16:30 // true: 已超时 // false: 未超时 function timeCompare() { var now = new Date(); var nowTime = now.getTime(); var year = now.getFullYear(); ;//js从0开始取 var date = now.getDate(); var deadlineStr = year + "/" + month + "/" + da