摆脱jQuery UI Datepicker上的下拉月份菜单

时间:2015-05-15 18:08:35

标签: jquery-ui jquery-ui-datepicker

enter image description here

我试图摆脱这里的下拉菜单(用红色圈出)并显示月份(以绿色圈出)

到目前为止,这是我的datepicker代码:

  <script>
    $(function() {
      $( "#from" ).datepicker({
        defaultDate: "+1w",
        changeMonth: true,
        numberOfMonths: 2,
        onClose: function( selectedDate ) {
          $( "#to" ).datepicker( "option", "minDate", selectedDate );
        }
      });
      $( "#to" ).datepicker({
        defaultDate: "+1w",
        changeMonth: true,
        numberOfMonths: 2,
        onClose: function( selectedDate ) {
          $( "#from" ).datepicker( "option", "maxDate", selectedDate );
        }
      });
    });

  </script>
  <label for="from">From</label>
  <input type="text" id="from" name="from">
  <label for="to">to</label>
  <input type="text" id="to" name="to">

1 个答案:

答案 0 :(得分:0)

摆脱changeMonth: true,

<强> jsFiddle example