jQuery UI: Datepicker set year range dropdown to 100 years

后端 未结 6 1767
粉色の甜心
粉色の甜心 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:39

    This worked perfectly for me.

    ChangeYear:- When set to true, indicates that the cells of the previous or next month indicated in the calendar of the current month can be selected. This option is used with options.showOtherMonths set to true.

    YearRange:- Specifies the range of years in the year dropdown. (Default value: “-10:+10″)

    Example:-

    $(document).ready(function() {
        $("#date").datepicker({
        changeYear:true,
        yearRange: "2005:2015"
        });
    });
    

    Refer :- set year range in jquery datepicker

提交回复
热议问题