How display only years in input Bootstrap Datepicker?

后端 未结 6 1073
谎友^
谎友^ 2021-01-30 21:06

I am using the following code to display only the years:

$(\"#datepicker\").datepicker( {viewMode: \"years\", minViewMode: \"years\"});

but inp

6条回答
  •  借酒劲吻你
    2021-01-30 21:29

    always year for bootstrap 3 datetimepicker https://eonasdan.github.io/bootstrap-datetimepicker/

       $('#year').datetimepicker({
            format: 'YYYY',
            viewMode: "years",
        });
    
        $("#year").on("dp.hide", function (e) {
            $('#year').datetimepicker('destroy');
            $('#year').datetimepicker({
                format: 'YYYY',
                viewMode: "years",
            });
        });
    

提交回复
热议问题