JQuery UI Datapicker:如何添加下一个/上一年的按钮

Joh*_*han 9 jquery datepicker

我使用选择下拉年份的功能.我用它来设置至少18岁的人的生日.到目前为止它完美无缺.我已使用theseg参数进行设置:

        $('#datepicker').datepicker({
        changeMonth: true,
        changeYear: true,
                    dateFormat: 'dd-mm-yy',
                    minDate: '-100Y',
                    maxDate: '-18Y'
    });
Run Code Online (Sandbox Code Playgroud)

不过,我想要年度导航.是否可以添加下一个/上一年的按钮?

在此先感谢您的帮助!

Pra*_*ana 15

检查一下:http://jqueryui.com/demos/datepicker/dropdown-month-year.html 它的datepicker插件的一部分

$(function() {
  $('#datepicker').datepicker({
   changeMonth: true,
   changeYear: true
  });
 });
Run Code Online (Sandbox Code Playgroud)

  • 比你可以去插入这个插件:http://www.eyecon.ro/datepicker/其中功能每年都在变化 (2认同)