728x90
반응형
Date 타입의 시작 날짜부터 종료 날짜까지 날짜들을 구하는 메소드
*자세한 설명 생략
/**
* Start to Last Date
* @param {*} startDate(Date)
* @param {*} lastDate(Date)
* @returns YYYY-MM-dd
*/
function getDatesStartToLast(startDate, lastDate) {
if (!(startDate instanceof Date && lastDate instanceof Date)) return "Not Date Object";
var result = [];
var curDate = startDate;
while (curDate <= lastDate) {
result.push(getFormatDate2(curDate));
curDate.setDate(curDate.getDate() + 1);
}
return result;
}
▷ 관련 글
728x90
728x90
'▶ Front-End > Javascript' 카테고리의 다른 글
Date Formater (0) | 2023.11.14 |
---|---|
Null Check (0) | 2023.11.14 |
댓글