공통 JS src/main/webapp/publish/js/urlUtils.js

src/main/webapp/publish/js/dateUtils.js
This commit is contained in:
hylee 2024-07-15 11:50:30 +09:00
parent 8ce7ee25a3
commit 082070c424
2 changed files with 59 additions and 3 deletions

View File

@ -1,7 +1,27 @@
$(document).ready(function () {
});
/**
* 날짜관련
* @author 이호영
* @since 2024.07.15
* @version 1.0
* @see
*
* <pre>
* << 개정이력(Modification Information) >>
*
* 수정일 수정자 수정내용
* ---------- -------- ---------------------------
* 2024.07.15 이호영 최초 생성
* 2020.xx.xx
* </pre>
*/
/**
* 검색 날짜관련 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;

View File

@ -0,0 +1,36 @@
/**
* URL 관련 팝업
* @author 이호영
* @since 2024.07.15
* @version 1.0
* @see
*
* <pre>
* << 개정이력(Modification Information) >>
*
* 수정일 수정자 수정내용
* ---------- -------- ---------------------------
* 2024.07.15 이호영 최초 생성
* 2020.xx.xx
* </pre>
*/
/**
* 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;
}