Bootstrap datepicker directive for Angular.
bower install https://github.com/lemonde/angular-bootstrap-datepicker.git
- Integrate the CSS stylesheet
components/bootstrap-datepicker/dist/css/bootstrap-datepicker3.css
- Integrate the datepicker js code
components/bootstrap-datepicker/js/bootstrap-datepicker.js
- (optional) integrate desired datepicker translations
components/bootstrap-datepicker/js/locales/bootstrap-datepicker.fr.js
In controller :
angular
.module('xyz', [
...
'bootstrap-datepicker',
In view :
<input bootstrap-datepicker required type="text" class="form-control"
placeholder="JJ/MM/AAAA"
ng-model="editionDate"
datepicker-io-format="YY-MM-DD"
datepicker-options="datepickerOptions"
ng-disabled="defaultMetadata" />
Options :
The datepicker is configured with default options : fr, autoclose, french date format
@param {string} datepicker-io-format (optional)
datepicker input / output format, in moment.js style. By default YYYY-MM-DD.@param {object} datepicker-options (optional)
datepicker options object as described in http://bootstrap-datepicker.readthedocs.org/en/release/options.html This object is merged with default options. This object is watched and the datepicker is reseted on change.
MIT