I am using bootstrap datepicker and my code is like following, Demo of the code on jsfiddle
You should have to add only minViewMode: "months"
in your datepicker function.
How about this :
$("#datepicker").datepicker( {
format: "mm-yyyy",
viewMode: "months",
minViewMode: "months"
});
Reference : Datepicker for Bootstrap
For version 1.2.0 and newer, viewMode
has changed to startView
, so use:
$("#datepicker").datepicker( {
format: "mm-yyyy",
startView: "months",
minViewMode: "months"
});
Also see the documentation.