2011-05-10 172 views
1

嗨我想創建日期範圍選擇器。下面是給定的代碼,我需要填寫。我如何突出顯示所有選定的日期JQuery DatePicker突出顯示日期選擇

$(document).ready(function() { 
     $("#fromCalendar").datepicker({ 
      numberOfMonths: [1, 6], 
      stepMonths: 1, 
      autoSize: true, 
      dateFormat: 'dd/mm/yy', 
      onSelect: function (date) { 
       selectDate(date); 
      } 

     }); 
    }); 
function selectDate(date){ 
//Code 
} 

回答

0
$(document).ready(function() { 
     numberOfMonths: [1, 6], 
     stepMonths: 3, 
     autoSize: true, 
     changeMonth: true, 
     changeYear: true, 
     dateFormat: 'dd/mm/yy', 
     onSelect: function (dateText, inst) { 
      selectDate(dateText); 
     }, 
     beforeShowDay: function (date) { 
      var gotDate = $.inArray($.datepicker.formatDate($(this).datepicker('option', 'dateFormat'), date), dates); 
      if (gotDate >= 0) { 
       return [false, "ui-state-highlight ui-state-active ui-state-hover"]; 
      } 
      return [true, ""]; 
     } 
}); 

}); 
0
your_text_box.focus(); 
your_text_box.select(); 

應該得到你的文本選擇,我相信。

+0

我想選擇日曆上的日期。謝謝... – 2011-05-10 02:47:34

相關問題