--- src/main/webapp/WEB-INF/jsp/web/pay/PayListAllAjax.jsp
+++ src/main/webapp/WEB-INF/jsp/web/pay/PayListAllAjax.jsp
... | ... | @@ -399,6 +399,7 @@ |
| 399 | 399 |
<span class="dateEtc">~</span> |
| 400 | 400 |
<input type="text" class="endDate inp calendar" title="검색 종료일" id="endDate" name="endDate" value="<c:out value="${searchVO.endDate}" />" data-datecontrol="true">
|
| 401 | 401 |
</div> |
| 402 |
+ <button type="button" onclick="fn_G_getCurrYearDateRange('startDate','endDate'); return false;" class="btnType btnType19">이번년도</button>
|
|
| 402 | 403 |
<button type="button" onclick="setCalVal(lastfulstday,'startDate');setCalVal( lastfuledday,'endDate'); return false;" class="btnType btnType19">전월</button> |
| 403 | 404 |
<button type="button" onclick="setCalVal(thisfulstlday,'startDate');setCalVal( thisfuledtlday,'endDate'); return false;" class="btnType btnType19">당월</button> |
| 404 | 405 |
<button type="button" onclick="linkPage(1); return false;" class="btnType btnType6">조회</button> |
--- src/main/webapp/publish/js/dateUtils.js
+++ src/main/webapp/publish/js/dateUtils.js
... | ... | @@ -57,3 +57,24 @@ |
| 57 | 57 |
|
| 58 | 58 |
return true; |
| 59 | 59 |
} |
| 60 |
+ |
|
| 61 |
+ |
|
| 62 |
+/** |
|
| 63 |
+ * 이번년도 시작날짜와 종료날짜 구하기 |
|
| 64 |
+ * @param {String} a 값 입력할 search start input ID
|
|
| 65 |
+ * @param {String} b 값 입력할 search start input ID
|
|
| 66 |
+ * @returns {String} a ID value 해당년도/01/01
|
|
| 67 |
+ * {String} b ID value 해당년도/12/31
|
|
| 68 |
+ */ |
|
| 69 |
+function fn_G_getCurrYearDateRange(startId, endId) {
|
|
| 70 |
+ |
|
| 71 |
+ // 현재 년도 구하기 |
|
| 72 |
+ var currentYear = new Date().getFullYear(); |
|
| 73 |
+ |
|
| 74 |
+ // 현재 년도를 기준으로 시작일과 종료일 설정 |
|
| 75 |
+ var startOfYear = currentYear + '/01/01'; |
|
| 76 |
+ var endOfYear = currentYear + '/12/31'; |
|
| 77 |
+ |
|
| 78 |
+ $('#'+startId).val(startOfYear);
|
|
| 79 |
+ $('#'+endId).val(endOfYear);
|
|
| 80 |
+} |
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?