--- src/main/java/itn/com/cmm/util/DateUtil.java
+++ src/main/java/itn/com/cmm/util/DateUtil.java
... | ... | @@ -135,7 +135,7 @@ |
| 135 | 135 |
} |
| 136 | 136 |
|
| 137 | 137 |
|
| 138 |
- public static boolean dateChk365AndValueChk(String searchStartDate, String searchEndDate) {
|
|
| 138 |
+ public static boolean dateChkAndValueChk(String searchStartDate, String searchEndDate, int dateVal) {
|
|
| 139 | 139 |
|
| 140 | 140 |
|
| 141 | 141 |
boolean isValid = true; |
... | ... | @@ -170,7 +170,7 @@ |
| 170 | 170 |
// 총 기간이 365일을 넘는지 확인 |
| 171 | 171 |
if (isValid) {
|
| 172 | 172 |
long daysBetween = ChronoUnit.DAYS.between(startDate, endDate); |
| 173 |
- if (daysBetween > 365) {
|
|
| 173 |
+ if (daysBetween > dateVal) {
|
|
| 174 | 174 |
isValid = false; |
| 175 | 175 |
} |
| 176 | 176 |
} |
--- src/main/java/itn/let/mjo/msgCustom/web/MjonMsgCustomWebController.java
+++ src/main/java/itn/let/mjo/msgCustom/web/MjonMsgCustomWebController.java
... | ... | @@ -229,7 +229,7 @@ |
| 229 | 229 |
// 검색 데이터가 없거나 |
| 230 | 230 |
// 시작일자가 종료일자보다 이후이거나 |
| 231 | 231 |
// 총 기간이 365일이 넘으면 현재일부터 365일 전 날짜를 넣어서 검색 |
| 232 |
- if(!DateUtil.dateChk365AndValueChk(mjonMsgCustomVO.getSearchStartDate(),mjonMsgCustomVO.getSearchEndDate() )) {
|
|
| 232 |
+ if(!DateUtil.dateChkAndValueChk(mjonMsgCustomVO.getSearchStartDate(),mjonMsgCustomVO.getSearchEndDate(), 365 )) {
|
|
| 233 | 233 |
|
| 234 | 234 |
mjonMsgCustomVO.setSearchStartDate(DateUtil.getDateDaysAgo(365)); |
| 235 | 235 |
mjonMsgCustomVO.setSearchEndDate(DateUtil.getCurrentDate()); |
--- src/main/java/itn/let/mjo/pay/web/MjonPayController.java
+++ src/main/java/itn/let/mjo/pay/web/MjonPayController.java
... | ... | @@ -2746,7 +2746,7 @@ |
| 2746 | 2746 |
// 검색 데이터가 없거나 |
| 2747 | 2747 |
// 시작일자가 종료일자보다 이후이거나 |
| 2748 | 2748 |
// 총 기간이 365일이 넘으면 현재일부터 365일 전 날짜를 넣어서 검색 |
| 2749 |
- if(!DateUtil.dateChk365AndValueChk(mjonMsgVO.getStartDate(),mjonMsgVO.getEndDate() )) {
|
|
| 2749 |
+ if(!DateUtil.dateChkAndValueChk(mjonMsgVO.getStartDate(),mjonMsgVO.getEndDate(), 365 )) {
|
|
| 2750 | 2750 |
|
| 2751 | 2751 |
mjonMsgVO.setStartDate(DateUtil.getDateDaysAgo(365)); |
| 2752 | 2752 |
mjonMsgVO.setEndDate(DateUtil.getCurrentDate()); |
--- src/main/webapp/publish/js/cmnDateAndChk.js
+++ src/main/webapp/publish/js/cmnDateAndChk.js
... | ... | @@ -28,7 +28,13 @@ |
| 28 | 28 |
var diffTime = Math.abs(end - start); |
| 29 | 29 |
var diffDays = Math.ceil(diffTime / (1000 * 60 * 60 * 24)); |
| 30 | 30 |
if (diffDays > chkDay) {
|
| 31 |
- alert("총 검색 기간은 "+chkDay+"일을 넘을 수 없습니다.");
|
|
| 31 |
+ |
|
| 32 |
+ var chkDayTxt = ""; |
|
| 33 |
+ if(chkDay == 365){
|
|
| 34 |
+ chkDayTxt = '1년'; |
|
| 35 |
+ } |
|
| 36 |
+ |
|
| 37 |
+ alert("총 검색 기간은 "+chkDayTxt+"을 넘을 수 없습니다.");
|
|
| 32 | 38 |
return false; |
| 33 | 39 |
} |
| 34 | 40 |
|
Add a comment
Delete comment
Once you delete this comment, you won't be able to recover it. Are you sure you want to delete this comment?