Bootstrap Datepicker - Months and Years Only

后端 未结 8 1552
逝去的感伤
逝去的感伤 2020-12-02 07:07

I am using bootstrap datepicker and my code is like following, Demo of the code on jsfiddle

8条回答
  •  -上瘾入骨i
    2020-12-02 08:07

    For the latest bootstrap-datepicker (1.4.0 at the time of writing), you need to use this:

    $('#myDatepicker').datepicker({
        format: "mm/yyyy",
        startView: "year", 
        minViewMode: "months"
    })
    

    Source: Bootstrap Datepicker Options

提交回复
热议问题