From 082070c424799648b4084d20232b3176798f578b Mon Sep 17 00:00:00 2001 From: hylee Date: Mon, 15 Jul 2024 11:50:30 +0900 Subject: [PATCH] =?UTF-8?q?=EA=B3=B5=ED=86=B5=20JS=20src/main/webapp/publi?= =?UTF-8?q?sh/js/urlUtils.js=20src/main/webapp/publish/js/dateUtils.js?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/webapp/publish/js/dateUtils.js | 26 +++++++++++++++--- src/main/webapp/publish/js/urlUtils.js | 36 +++++++++++++++++++++++++ 2 files changed, 59 insertions(+), 3 deletions(-) create mode 100644 src/main/webapp/publish/js/urlUtils.js diff --git a/src/main/webapp/publish/js/dateUtils.js b/src/main/webapp/publish/js/dateUtils.js index 59c40e71..6b4e2caa 100644 --- a/src/main/webapp/publish/js/dateUtils.js +++ b/src/main/webapp/publish/js/dateUtils.js @@ -1,7 +1,27 @@ -$(document).ready(function () { - -}); +/** + * 날짜관련 + * @author 이호영 + * @since 2024.07.15 + * @version 1.0 + * @see + * + *
+ * << 개정이력(Modification Information) >>
+ *
+ *   수정일         수정자        수정내용
+ *  ----------    --------    ---------------------------
+ *  2024.07.15    이호영        최초 생성
+ *  2020.xx.xx    
+ *  
+ */ +/** + * 검색 날짜관련 ID와 체크할 월을 가지고 체크하는 function + * @param {String} a 검색 시작 ID + * @param {String} b 검색 종료 ID + * @param {String} c 체크할 month + * @returns {Boolean} a날짜와 b날짜를 비교해서 c월 이상이면 false 이하면 true + */ function fn_G_cmndataValueChk(startId, endId, chkMonth) { // 시작일자와 종료일자를 가져오기 var startDate = document.getElementById(startId).value; diff --git a/src/main/webapp/publish/js/urlUtils.js b/src/main/webapp/publish/js/urlUtils.js new file mode 100644 index 00000000..709d547b --- /dev/null +++ b/src/main/webapp/publish/js/urlUtils.js @@ -0,0 +1,36 @@ +/** + * URL 관련 팝업 + * @author 이호영 + * @since 2024.07.15 + * @version 1.0 + * @see + * + *
+ * << 개정이력(Modification Information) >>
+ *
+ *   수정일         수정자        수정내용
+ *  ----------    --------    ---------------------------
+ *  2024.07.15    이호영        최초 생성
+ *  2020.xx.xx    
+ *  
+ */ + + +/** + * url의 마지막 / 다음 정보만 가져오기 + * @returns {String} (예시)http://localhost:8080/web/kakao/sent/selectKakaoSentView.do + * 위 url에서 selectKakaoSentView.do 이 부분만 가져온다. + */ +function fn_G_getLastUrlSegment(){ + // 전체 경로 가져오기 + const pathname = window.location.pathname; + + // 경로를 '/'로 분할하여 배열로 만들기 + const pathSegments = pathname.split('/'); + + // 배열의 마지막 요소 가져오기 + const lastSegment = pathSegments.pop() || pathSegments.pop(); + + return lastSegment; +} +