How display only years in input Bootstrap Datepicker?

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

    For bootstrap datetimepicker, assign decade value as follow:

    $(".years").datetimepicker({
        format: "yyyy",
        startView: 'decade',
        minView: 'decade',
        viewSelect: 'decade',
        autoclose: true,
    });
    

提交回复
热议问题