Browse Source

质量符合开始结束时间判断

user5 2 years ago
parent
commit
84f0b24b00

+ 17 - 1
src/main/webapp/webpage/modules/ruralprojectrecords/cost/projectcontentinfo/new/reportForm.jsp

@@ -71,7 +71,23 @@
 							return false;
 						}
 
-						var newDate =  new Date()
+						const year = new Date().getFullYear();
+						const month = new Date().getMonth();
+						const day = new Date().getDate();
+						var newDate = new Date(year, month, day, 0, 0, 0);
+						console.log(newDate); // Wed Jan 13 2021 00:00:00 GMT+0800 (中国标准时间)
+
+						const startDateYear = startDate.getFullYear();
+						const startDateMonth = startDate.getMonth();
+						const startDateDay = startDate.getDate();
+						startDate = new Date(startDateYear, startDateMonth, startDateDay, 0, 0, 0);
+
+						const endingDateYear = startDate.getFullYear();
+						const endingDateMonth = startDate.getMonth();
+						const endingDateDay = startDate.getDate();
+						endingDate = new Date(endingDateYear, endingDateMonth, endingDateDay, 0, 0, 0);
+
+
 						if(startDate.getTime() > newDate.getTime() || endingDate.getTime() < newDate.getTime()){
 
 							top.layer.open({

+ 15 - 1
src/main/webapp/webpage/modules/ruralprojectrecords/cost/projectcontentinfo/new/reportModify.jsp

@@ -66,7 +66,21 @@
 					parent.layer.msg("工作开始日期不得大于工作结束日期!", {icon: 5});
 					return false;
 				}
-				var newDate =  new Date()
+				const year = new Date().getFullYear();
+				const month = new Date().getMonth();
+				const day = new Date().getDate();
+				var newDate = new Date(year, month, day, 0, 0, 0);
+
+				const startDateYear = startDate.getFullYear();
+				const startDateMonth = startDate.getMonth();
+				const startDateDay = startDate.getDate();
+				startDate = new Date(startDateYear, startDateMonth, startDateDay, 0, 0, 0);
+
+				const endingDateYear = startDate.getFullYear();
+				const endingDateMonth = startDate.getMonth();
+				const endingDateDay = startDate.getDate();
+				endingDate = new Date(endingDateYear, endingDateMonth, endingDateDay, 0, 0, 0);
+				console.log(newDate); // Wed Jan 13 2021 00:00:00 GMT+0800 (中国标准时间)
 				if(startDate.getTime() > newDate.getTime() || endingDate.getTime() < newDate.getTime()){
 
 					top.layer.open({

+ 15 - 1
src/main/webapp/webpage/modules/ruralprojectrecords/ruralporjectmessage/projectcontentinfo/new/judgementReport/projectRecordsJudgementForm.jsp

@@ -71,7 +71,21 @@
 							return false;
 						}
 
-						var newDate =  new Date()
+						const year = new Date().getFullYear();
+						const month = new Date().getMonth();
+						const day = new Date().getDate();
+						var newDate = new Date(year, month, day, 0, 0, 0);
+
+						const startDateYear = startDate.getFullYear();
+						const startDateMonth = startDate.getMonth();
+						const startDateDay = startDate.getDate();
+						startDate = new Date(startDateYear, startDateMonth, startDateDay, 0, 0, 0);
+
+						const endingDateYear = startDate.getFullYear();
+						const endingDateMonth = startDate.getMonth();
+						const endingDateDay = startDate.getDate();
+						endingDate = new Date(endingDateYear, endingDateMonth, endingDateDay, 0, 0, 0);
+						console.log(newDate); // Wed Jan 13 2021 00:00:00 GMT+0800 (中国标准时间)
 						if(startDate.getTime() > newDate.getTime() || endingDate.getTime() < newDate.getTime()){
 
 							top.layer.open({

+ 15 - 1
src/main/webapp/webpage/modules/ruralprojectrecords/ruralporjectmessage/projectcontentinfo/new/judgementReport/projectRecordsJudgementMessageModify.jsp

@@ -56,7 +56,21 @@
                     parent.layer.msg("工作开始日期不得大于工作结束日期!", {icon: 5});
                     return false;
                 }
-                var newDate =  new Date()
+                const year = new Date().getFullYear();
+                const month = new Date().getMonth();
+                const day = new Date().getDate();
+                var newDate = new Date(year, month, day, 0, 0, 0);
+
+                const startDateYear = startDate.getFullYear();
+                const startDateMonth = startDate.getMonth();
+                const startDateDay = startDate.getDate();
+                startDate = new Date(startDateYear, startDateMonth, startDateDay, 0, 0, 0);
+
+                const endingDateYear = startDate.getFullYear();
+                const endingDateMonth = startDate.getMonth();
+                const endingDateDay = startDate.getDate();
+                endingDate = new Date(endingDateYear, endingDateMonth, endingDateDay, 0, 0, 0);
+                console.log(newDate); // Wed Jan 13 2021 00:00:00 GMT+0800 (中国标准时间)
                 if(startDate.getTime() > newDate.getTime() || endingDate.getTime() < newDate.getTime()){
 
                     top.layer.open({

+ 15 - 1
src/main/webapp/webpage/modules/ruralprojectrecords/ruralporjectmessage/projectcontentinfo/new/projectRecordsMessageModify.jsp

@@ -56,7 +56,21 @@
                     parent.layer.msg("工作开始日期不得大于工作结束日期!", {icon: 5});
                     return false;
                 }
-                var newDate =  new Date()
+                const year = new Date().getFullYear();
+                const month = new Date().getMonth();
+                const day = new Date().getDate();
+                var newDate = new Date(year, month, day, 0, 0, 0);
+
+                const startDateYear = startDate.getFullYear();
+                const startDateMonth = startDate.getMonth();
+                const startDateDay = startDate.getDate();
+                startDate = new Date(startDateYear, startDateMonth, startDateDay, 0, 0, 0);
+
+                const endingDateYear = startDate.getFullYear();
+                const endingDateMonth = startDate.getMonth();
+                const endingDateDay = startDate.getDate();
+                endingDate = new Date(endingDateYear, endingDateMonth, endingDateDay, 0, 0, 0);
+                console.log(newDate); // Wed Jan 13 2021 00:00:00 GMT+0800 (中国标准时间)
                 if(startDate.getTime() > newDate.getTime() || endingDate.getTime() < newDate.getTime()){
 
                     top.layer.open({

+ 15 - 1
src/main/webapp/webpage/modules/ruralprojectrecords/ruralporjectmessage/projectcontentinfo/new/reportForm.jsp

@@ -45,7 +45,21 @@
 							parent.layer.msg("工作开始日期不得大于工作结束日期!", {icon: 5});
 							return false;
 						}
-						var newDate =  new Date()
+						const year = new Date().getFullYear();
+						const month = new Date().getMonth();
+						const day = new Date().getDate();
+						var newDate = new Date(year, month, day, 0, 0, 0);
+
+						const startDateYear = startDate.getFullYear();
+						const startDateMonth = startDate.getMonth();
+						const startDateDay = startDate.getDate();
+						startDate = new Date(startDateYear, startDateMonth, startDateDay, 0, 0, 0);
+
+						const endingDateYear = startDate.getFullYear();
+						const endingDateMonth = startDate.getMonth();
+						const endingDateDay = startDate.getDate();
+						endingDate = new Date(endingDateYear, endingDateMonth, endingDateDay, 0, 0, 0);
+						console.log(newDate); // Wed Jan 13 2021 00:00:00 GMT+0800 (中国标准时间)
 						if(startDate.getTime() > newDate.getTime() || endingDate.getTime() < newDate.getTime()){
 
 							top.layer.open({