티스토리 뷰
const selectedDate = new Date($("#txt_new_warehouse_in_Date").val());
var currentDate = new Date($("#txt_warehouse_in_Date").val()); // current date
// 비교 연상자가 시간까지 계산식에 포함시기 때문에 시간을 0으로 설정
currentDate = new Date(currentDate.getFullYear(), currentDate.getMonth(), currentDate.getDate(), 0, 0, 0, 0);
let pastDate = new Date(currentDate.getTime() - (5 * 24 * 60 * 60 * 1000));
let futureDate = new Date(currentDate.getTime() + (5 * 24 * 60 * 60 * 1000));
console.log("selectedDate : " + selectedDate);
console.log("currentDate : " + currentDate);
console.log("pastDate : " + pastDate);
console.log("futureDate : " + futureDate);
if (selectedDate >= pastDate && selectedDate <= futureDate) { } else {
alert("New warehouse in date is outside 5 days range");
return;
}
반응형
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
TAG
- mssql
- System.Diagnostics
- Task
- 아이폰
- trim
- await
- html tag
- 특정 문자를 기준으로 자르기
- nl2br
- In App Purchase
- 진수 변환
- MainActor
- system.io
- 공백제거
- hyper-v
- async
- .submit()
- 문자 자르기
- 앱 스토어
- FileUpload
- App Store
- 명령어
- 상품 등록
- 제품 등록
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |
글 보관함