2011-10-20 10 views
0

안녕하세요 저는 fromdate 및 todate 양식에 2 jquery 날짜 선택기가 있습니다. 피커에서 다음 기능을 수행해야합니다. todate가 사용 가능하거나 fromdate가 선택된 경우에만 사용 가능합니다. -js fromdse의 onselect()를 호출합니까? todate의 날짜는 최대 30 일, 30 일 이후 및 이전 날짜는 사용할 수 없습니다. - 즉 todate에 maxdate 매개 변수를 설정 하시겠습니까? 어떻게 달성 할 수 있는지 알아야합니다. 감사합니다. Priyankjquery datepicker 사용 중지 날짜

안녕하세요. 저는 일을하고 있지만 캘린더를 사용할 수 없게되는 일은 일어나지 않았습니다. 여기에 내 현재 달력과 오늘 달력이 있습니다. 글쓰기 지금은 기본적으로 두 번째 캘린더를 사용하지 않으려 고합니다. 아직 활성화 할 수있는 onselect 함수를 아직 작성하지 않았지만 사용하지 않도록 설정하지 않았습니다. 다른 방법이 있나요? disabled = true가 datetimepicker에서 작동하지 않습니다. 감사 Priyank

<span class="labels">To Date</span> 
<input type="text" name="dateFrom" value="" id="datefrom"> 

<script> 
jQuery(function() { 
jQuery("#datefrom").datetimepicker({ dateFormat: 'yy-mm-dd', 
    showSecond: true, 
    timeFormat: 'hh:mm:ss', 
    changeMonth: true, 
    changeYear: true, 
    maxDate: new Date, 
    minDate: new Date('2011-08-02'), 
    showOn: "button", 
    buttonImage: "/calendar.png", 
    buttonImageOnly: true }); 
    onSelect: function enabletoDate(dateText, inst) { } 
}); 
</script> 

<span class="labels">To Date</span> 
<input type="text" name="dateto" value="" id="dateto"> 

<script> 
jQuery(function() { 
jQuery("#dateto").datetimepicker({ 
    disabled: true, 
    dateFormat: 'yy-mm-dd', 
    showSecond: true, 
    timeFormat: 'hh:mm:ss', 
    changeMonth: true, 
    changeYear: true, 
    showOn: "button", 
    buttonImage: "/images/users/calendar.png", 
    buttonImageOnly: true }); 
}); 

</script> 
+0

코드를 게시 할 수 있습니까? –

답변

0

당신이 JQuery와 UI의 날짜 선택기는 선택기에 대한 maxDate 및 minDate 속성을 설정할 수 있습니다 사용하는 경우.

http://jqueryui.com/demos/datepicker/

+0

내가 datetimepicker를 사용하고 있습니다 : Trent Richardson –

관련 문제