How display only years in input Bootstrap Datepicker?

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

    Try this

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

    $("#datepicker").datepicker( {
        format: " yyyy", // Notice the Extra space at the beginning
        viewMode: "years", 
        minViewMode: "years"
    });
    

提交回复
热议问题