Search code examples
javascriptjquerytwitter-bootstrapdatepickerbootstrap-datepicker

How to set maxViewMode in Bootstrap Datepicker (with JS Fiddle)


I have a simple installation of Bootstrap Datepicker:

HTML:

<div id="datepicker"></div>

JS:

$("#datepicker").datepicker( {minViewMode: "days", maxViewMode: "days"});

I am trying to disable the user's ability to switch to month view (achieved by clicking on the month title). I have set maxViewMode to days as per the docs, but it doesn't work.

JS Fiddle here.

Where am I going wrong? Is this a bug?


Solution

  • You are using Bootstrap Datepicker version 1.4.0. Option maxViewMode is added in version 1.5.0 (not released yet).

    Official docs for version 1.4.0