How display only years in input Bootstrap Datepicker?

后端 未结 6 1074
谎友^
谎友^ 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:40

    $("#year").datepicker( {
        format: "yyyy",
        viewMode: "years", 
        minViewMode: "years"
    }).on('changeDate', function(e){
        $(this).datepicker('hide');
    });
    

提交回复
热议问题