채택완료

달력 문의드립니다.

2016-12-21 (수) 23:05:38 5,475

http://rhdtkd77.dothome.co.kr/ 

달력을 현재 12월이 아닌 1월달 날짜 아무거나 클릭하면

날짜 선택은 제대로 되지만

달력이 12월로 돌아가버리는데요 

혹시 1월 그대로 멈추게 할수있는방법은 없는걸까여?

Copy
<?phpadd_stylesheet('<link type="text/css" href="//ajax.googleapis.com/ajax/libs/jqueryui/1.8.4/themes/base/jquery-ui.css" rel="stylesheet" />', 0);?><style type="text/css"> .ui-datepicker { font:11px dotum; }.ui-datepicker select.ui-datepicker-year { width:60px;}.ui-datepicker select.ui-datepicker-month { width:40px;}</style> <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jqueryui/1.8.4/jquery-ui.min.js"></script> <link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">  <link rel="stylesheet" href="/resources/demos/style.css">  <script src="https://code.jquery.com/jquery-1.12.4.js"></script>  <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script><script type="text/javascript"> //<![CDATA[ $(document).ready(function() {  $("#ap_cal").datepicker({ dateFormat: 'ymmdd', monthNamesShort: ['1','2','3','4','5','6','7','8','9','10','11','12'], changeMonth: true, changeYear: true, showMonthAfterYear: true, //maxDate: "+0D", onSelect: function(dateText) { location.href = '<?php echo G5_BBS_URL; ?>/search.php?sfl=wr_subject&stx=' + dateText; } }); }); //]]> </script> <div id="ap_cal"></div>

이 달력으로는 그런건 불가능한건가여?

|

답변 1개

채택된 답변
+20 포인트
2016-12-22 (목) 04:50:48

다음과 같이
$("#ap_cal").datepicker({
   해당 내용
});
이 스크립트 끝 부분에 setDate 값을 추가해 보세요.

Copy
<script type="text/javascript"> //<![CDATA[ $(document).ready(function() {   $("#ap_cal").datepicker({    dateFormat: 'ymmdd',    monthNamesShort: ['1','2','3','4','5','6','7','8','9','10','11','12'],    changeMonth: true,    changeYear: true,    showMonthAfterYear: true,    //maxDate: "+0D",    onSelect: function(dateText) {      location.href = '<?php echo G5_BBS_URL;?>/search.php?sfl=wr_subject&stx=' + dateText;    }  }).datepicker("setDate", "<?php echo $stx;?>"); }); //]]> </script>
 

답변을 작성하려면 로그인이 필요합니다.