Jquery datepicker年变化 [英] Jquery datepicker years change

查看:85
本文介绍了Jquery datepicker年变化的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用jquery的datepicker来设置一个字段来生成日期,而默认选择器显示为每月滚动到日期的选项。有没有一种方法可以直接改变年份,而是使用数月来轮流改变一年。

I am using datepicker of jquery for a field to set date of birth, while default picker is displayed which gives option to scroll to date monthly and sounds tedious. Is there a way by which I can change years directly rather using months to change the year in turn.

推荐答案

有一个<$您可以设置为 true 的datepicker上的c $ c> changeYear 属性。

There's a changeYear property on the datepicker that you can set to true.

$( ".selector" ).datepicker({ changeYear: true });

http://jqueryui.com/datepicker/#dropdown-month-year

这将呈现一个选择列表,从中选择你可以选择你想要的年份。

This will render a select list from which you can choose the year you'd like.

这篇关于Jquery datepicker年变化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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