From ad5e517f233594a9aa322662f18486a60d4b954c Mon Sep 17 00:00:00 2001 From: shangguanyanfei Date: Fri, 26 Apr 2019 18:02:22 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=9A=E6=97=B6=E5=99=A8=E5=85=AC=E5=85=B1?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2-=E9=95=BF=E6=9C=9F=E9=80=89=E9=A1=B9?= =?UTF-8?q?=EF=BC=8C=E5=A2=9E=E5=8A=A0=E5=BC=80=E5=A7=8B=E6=97=B6=E9=97=B4?= =?UTF-8?q?=E4=B8=8D=E8=83=BD=E5=B0=8F=E4=BA=8E=E5=BD=93=E5=89=8D=E6=97=B6?= =?UTF-8?q?=E9=97=B4=E5=8A=A0=E4=B8=8A2=E5=88=86=E9=92=9F=E7=9A=84?= =?UTF-8?q?=E9=AA=8C=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../WEB-INF/include/form/scheduleNew.jsp | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/main/webapp/WEB-INF/include/form/scheduleNew.jsp b/src/main/webapp/WEB-INF/include/form/scheduleNew.jsp index 42820a24b..3681077ed 100644 --- a/src/main/webapp/WEB-INF/include/form/scheduleNew.jsp +++ b/src/main/webapp/WEB-INF/include/form/scheduleNew.jsp @@ -19,6 +19,22 @@ var diff=$.validator.messages.expireTip; var tip=$.validator.messages.compareTip; var date="2019-03-25 "; + //always 开始时间不能小于当前时间加上2分钟 验证 + jQuery.validator.addMethod("alwaysStartDate",function(value,element){ + var flagTypeSame=true; + var alwaysValid = $("#alwaysValid").val(); + if(alwaysValid !=null && alwaysValid !=""){ + var date =new Date(); + var min=date.getMinutes(); + date.setMinutes(min+2); + if(date <= (new Date(alwaysValid.replace(/-/g,"\/")))){ + flagTypeSame=true; + }else{ + flagTypeSame=false; + } + } + return flagTypeSame; + },tip); //one 开始时间不能小于当前时间加上2分钟 验证 jQuery.validator.addMethod("oneStartDate",function(value,element){ var flagTypeSame=true; @@ -244,7 +260,7 @@
- +