본문 바로가기
Web/jQuery

[jQuery] datepicker 예제

by 나비와꽃기린 2016. 7. 20.
336x280(권장), 300x250(권장), 250x250, 200x200 크기의 광고 코드만 넣을 수 있습니다.

두개의 달력 ()~() 범위에서 minDate, maxDate 설정@@


$("#datepicker1").datepicker({

dateFormat:'yy-mm-dd'

,showMonthAfterYear : true

,changeMonth : true

,changeYear : true

,numberOfMonths:1

,showOn:'both'

,buttonImage:'/images/iconCalendarSmall.gif' 

,buttonImageOnly :true 

,buttonText :"날짜선택"

,dayNamesMin : ['일','월','화','수','목','금','토']

,monthNamesShort:['1월','2월','3월','4월','5월','6월','7월','8월','9월','10월','11월','12월']

,onClose:function(selectedDate){

$('#datepicker2').datepicker("option","minDate",selectedDate);

}

//,minDate : -0 //오늘날짜 이후부터만 설정되게

});

$("#datepicker2").datepicker({

dateFormat:'yy-mm-dd'

,showMonthAfterYear : true

,changeMonth : true

,changeYear : true

,numberOfMonths:1

,showOn:'both'

,buttonImage:'/images/iconCalendarSmall.gif' 

,buttonImageOnly :true 

,buttonText :"날짜선택"

,dayNamesMin : ['일','월','화','수','목','금','토']

,monthNamesShort:['1월','2월','3월','4월','5월','6월','7월','8월','9월','10월','11월','12월']

,onClose:function(selectedDate){

$('#datepicker1').datepicker("option","maxDate",selectedDate);

}

//,minDate : -0 //오늘날짜 이후부터만 설정되게

});