Bootstrap-datepicker provides a flexible datepicker widget in the Bootstrap style. Versions are incremented according to semver. As with bootstrap’s own plugins, datepicker provides a data-api that can be used to instantiate datepickers without the need for custom javascript. You can disable datepicker’s data-api in the same way as you would disable other bootstrap plugins. Most options can be provided via data-attributes. An option can be converted to a data-attribute by taking its name, replacing each uppercase letter with its lowercase equivalent preceded by a dash, and prepending “data-date-” to the result. Methods are called on a datepicker by calling the datepicker function with a string first argument, followed by any arguments the method takes.
Features
- autoclose, whether or not to close the datepicker immediately when a date is selected
- assumeNearbyYear, if true, manually-entered dates with two-digit years, such as “5/1/15”, will be parsed as “2015”, not “15”
- beforeShowDay, a function that takes a date as a parameter and returns a specific value
- calendarWeeks, whether or not to show week numbers to the left of week rows
- clearBtn, if true, displays a “Clear” button at the bottom of the datepicker to clear the input value
- container, appends the date picker popup to a specific element; eg: container: ‘#picker-container’ (will default to “body”)