JQuery UI Datapicker:如何添加下一个/上一年的按钮 [英] JQuery UI Datapicker : How to add next/previous year buttons

查看:197
本文介绍了JQuery UI Datapicker:如何添加下一个/上一年的按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用下拉菜单选择年份的功能。我用它来设置至少18岁的人的生日。到目前为止,它的工作完美。我已经设置了这些参数:

I use the feature of selecting a year with a dropdown. I use it to set birthdays of people at least 18 years old. So far it works perfectly. I have set it up using theseg parameters:

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

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

However I'd like to have year navigation. Is it possible to add a next/previous year button?

提前感谢任何帮助!

推荐答案

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

Check this : http://jqueryui.com/demos/datepicker/dropdown-month-year.html its part of datepicker plug in

$(function() {
  $('#datepicker').datepicker({
   changeMonth: true,
   changeYear: true
  });
 });

这篇关于JQuery UI Datapicker:如何添加下一个/上一年的按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆