Skip to content
This repository has been archived by the owner on Jul 22, 2020. It is now read-only.

lemonde/angular-bootstrap-datepicker

Repository files navigation

angular-bootstrap-datepicker

Build Status Dependency Status devDependency Status

Bootstrap datepicker directive for Angular.

Install

Using bower

bower install https://github.com/lemonde/angular-bootstrap-datepicker.git

Usage

Resources setup

  1. Integrate the CSS stylesheet components/bootstrap-datepicker/dist/css/bootstrap-datepicker3.css
  2. Integrate the datepicker js code components/bootstrap-datepicker/js/bootstrap-datepicker.js
  3. (optional) integrate desired datepicker translations components/bootstrap-datepicker/js/locales/bootstrap-datepicker.fr.js

Directive instanciation

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.

License

MIT