AngularJS wrapper for the awesome bootstrap-datepicker by @eternicode.
Installation
bower
bower install ng-eternicode-datepicker --save
npm
npm install ng-eternicode-datepicker --save
Other
Download file dist/ng-eternicode-datepicker.min.js
Include files
The original bootstrap-datepicker
files have to be included first. These files are required:
If you want to use a different language remember to include the appropriate bootstrap-datepicker language file. For example:
Usage
Remember to add the module fk.eternicode-datepicker
as a dependency to your angular module:
angular;
Text input
!! ATTENTION !!
You can't apply datepicker
and ng-model
directly to an input field.
As the bootstrap-datepicker
changes the value of the input field, this would mess around with our model.
Component
Embedded / Inline
Range
Currently not supported.
Options
To pass additional datepicker options use the dp-options
attribute:
<!-- dp-options not ng-options! -->
// Inside your controller$scopedatepickerOptions = autoclose: true;
Please refer to the bootstrap-datepicker docs to learn more about supported options.
datepickerDefaultsProvider
Many options will be the same for every datepicker in your app. At least the language and date format should be consinstent. For this reason you could set default options which are used for every datepicker with the datepickerDefaultsProvider
.
angular ;
Ofcourse you could override or extend your defaults with the dp-options
attribute.
Todo
- Tests
- Angular form validation
License
MIT