jQuery UI: Datepicker set year range dropdown to 100 years

后端 未结 6 1769
粉色の甜心
粉色の甜心 2020-12-07 07:18

Using the Datepicker the year drop down by default shows only 10 years. The user has to click the last year in order to get more years added.

How can we set the init

6条回答
  •  孤城傲影
    2020-12-07 07:51

    I did this:

    var dateToday = new Date();
    var yrRange = dateToday.getFullYear() + ":" + (dateToday.getFullYear() + 50);
    and then
    yearRange : yrRange
    

    where 50 is the range from current year.

提交回复
热议问题