jQuery UI: Datepicker set year range dropdown to 100 years

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

    You can set the year range using this option in jQuery UI datepicker:

    yearRange: "c-100:c+0", // last hundred years and current years
    
    yearRange: "c-100:c+100", // last hundred years and future hundred years
    
    yearRange: "c-10:c+10", // last ten years and future ten years
    

提交回复
热议问题