Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JQuery UI Datapicker : How to add next/previous year buttons

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?

Thanks in advance for any help!

like image 402
Johan Avatar asked Aug 06 '10 12:08

Johan


1 Answers

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

$(function() {
  $('#datepicker').datepicker({
   changeMonth: true,
   changeYear: true
  });
 });
like image 130
Pranay Rana Avatar answered Oct 06 '22 20:10

Pranay Rana