[Javascript] – 자바스크립트 날짜 비교

<input type=”text” name=”startDate” value=”2013. 08. 20″ />

<input type=”text” name=”endDate” value=”2013. 08. 04″ />

var startDate = $(“input[name=startDate]”).val().split(“. “);

var endDate  = $(“input[name=endDate]”).val().split(“. “);

var sDate    = new Date(startDate[0], startDate[1], startDate[2]).valueOf();

var eDate    = new Date(endDate[0], endDate[1], endDate[2]).valueOf();

if( sDate > eDate )

{

alert(“최초 등록일이 도메인 종료일보다 클수 없습니다.”);

return false;

}

참고 – http://mrkn.tistory.com/234

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s