Jquery datepicker years change

Sankalp picture Sankalp · Sep 12, 2011 · Viewed 55k times · Source

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.

Answer

Jamie Dixon picture Jamie Dixon · Sep 12, 2011

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.