在Jquery日历中显示其他月份的日期以及月份和年份菜单

时间:2017-06-29 11:41:52

标签: jquery calendar

我正在尝试修改Jquery日历以显示月份和年份菜单以及其他月份的显示日期。

在其他月份显示日期的代码是:

<script>
  $( function() {
    $( "#datepicker" ).datepicker({
      showOtherMonths: true,
      selectOtherMonths: true
    });
  } );
  </script>

显示月份和年份的代码:

 <script>
  $( function() {
    $( "#datepicker" ).datepicker({
      changeMonth: true,
      changeYear: true
    });
  } );
  </script>

当我尝试将两者结合起来时,它不起作用,它是否是日历中无法修复的错误?

<script>
  $( function() {
    $( "#datepicker" ).datepicker({
      showOtherMonths: true,
      selectOtherMonths: true

      changeMonth: true,
      changeYear: true
    });
  } );
  </script>

&#13;
&#13;
<link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
  <link rel="stylesheet" href="///code.jquery.com/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>
  $( function() {
    $( ".myDatepicker" ).datepicker({
      showOtherMonths: true,
      selectOtherMonths: true,
      changeMonth: true,
      changeYear: true
    });
  } );
  </script>

 
<p>Date: <input type="text" id="datepicker1" class="myDatepicker"></p>
 fsdfsdfsd
 
 sdf
 sdf
 sdf
 
 <p>Date: <input type="text" id="datepicker2" class="myDatepicker"></p>
 
  fsdfsdfsd
 
 sdf
 sdf
 sdf
 <p>Date: <input type="text" id="datepicker3" class="myDatepicker"></p>
&#13;
&#13;
&#13;

enter image description here enter image description here

我想把两者结合起来。

1 个答案:

答案 0 :(得分:0)

将代码更改为以下和工作

df['lat'] = df['latlng'].str[0]
df['lng'] = df['latlng'].str[1]