Jquery datepicker years change

后端 未结 5 1189
Happy的楠姐
Happy的楠姐 2021-02-11 23:09

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 w

5条回答
  •  悲&欢浪女
    2021-02-11 23:19

    Set changeYear: true, as shown in sample code below:

     $("#birth_date").datepicker({
                dateFormat: 'yy-mm-dd',
                changeMonth: true,
                changeYear: true,
                maxDate: '-1D'
            },
            $.datepicker.regional["fr"]
        );
    

    Refer here for more options: https://jqueryui.com/datepicker/

提交回复
热议问题