반응형
Notice
Recent Posts
Recent Comments
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- MySQL
- jmeter
- docker-compose
- docker
- Docker Compose
- redis
- Redis Sentinel
- JPA
- cassandra
- grafana
- RabbitMQ
- mybatis
- Spring Open Feign
- spring cloud
- argo cd
- Selenium
- Netty
- spring boot
- weblogic 10
- vue.js
- docker compose mysql
- QueryDSL
- coalesce
- Hibernate
- netflix oss
- Airflow
- WebLogic
- ChannelPipeline
- spring boot redis
- KAFKA
Archives
- Today
- Total
IT.FARMER
javascript 날짜 between 유사기능 (날짜와 날짜 사이) 본문
반응형
start_expirationDate 와 end_expirationDate 사이에 기준 날짜가 끼어 있으면 OOO기능을 수행한다.
function dateCheck(start_expirationDate, end_expirationDate ){
var today = new Date();
var criterionDate = new Array();
var resultCalObj = calenderTemplate(today);
criterionDate.push(today.getFullYear());
criterionDate.push(resultCalObj.temp_geyMonth);
criterionDate.push(resultCalObj.temp_getDate);
criterionDate = criterionDate.join("");
start_expirationDate = "20100923";
end_expirationDate = "20100924";
//1.공지 팝업 시작 날짜가 기준(오늘) 날짜보다 크거나 같으면,true
//2.공지 팝업 종료 날짜가 기준(오늘) 날짜보다 크거나 같으면, true
if(criterionDate <= start_expirationDate){
if(criterionDate <= end_expirationDate){
alert(criterionDate);
}
}else if(criterionDate > start_expirationDate){
if(criterionDate <= end_expirationDate){
alert(criterionDate);
}
}
}
// @criterionDate : 기준날짜 ,
// #sample 형식 :201011
// 결과 :20100101
function calenderTemplate(criterionDate){
var temp_geyMonth = "";
var temp_getDate = "";
if(criterionDate.getMonth()+1 < 10){
temp_geyMonth = "0"+eval(criterionDate.getMonth()+1);
}else{
temp_geyMonth = criterionDate.getMonth()+1;
}
if(criterionDate.getDate() <10){
temp_getDate = "0"+ criterionDate.getDate();
}else{
temp_getDate = criterionDate.getDate();
}
var resultObj = {
"temp_geyMonth" : temp_geyMonth,
"temp_getDate" : temp_getDate
}
return resultObj;
}
반응형
'JavaScript > script' 카테고리의 다른 글
javascript 웹페이지의 선택된 node 옴기기 (0) | 2010.10.19 |
---|---|
javascript 인,디 코드 (0) | 2010.09.27 |
내가 원하는 childNodes 가져오기 (0) | 2010.06.07 |
DOM 으로 Table, DIV 생성 (0) | 2010.06.07 |
DOM 으로 생성된 ChildNodes 삭제 하기. - removeChild (0) | 2010.06.07 |