koco-date-range-picker-binding-handler
Version:
Knockout Components binding handler for bootstrap-daterangepicker
54 lines (41 loc) • 1.57 kB
Markdown
# koco-date-range-picker-binding-handler
Knockout Components binding handler for Dan Grossman's bootstrap-daterangepicker.
## Installation
```bash
bower install koco-order-by-updater-binding-handler
```
## Usage with KOCO
This is a shared module that is used in many other modules. The convention is to require the handler in the `knockout-binding-handlers.js` file like so:
```javascript
define([
...
'bower_components/koco-date-range-picker-binding-handler/src/date-range-picker-binding-handler'
...
],
```
It also includes the `moment`, `koco-disposer` libraries and a modified version of `bootstrap-daterangepicker` as bower dependencies. You will need to configure an alias in the `require.configs.js` file for the dependency if you haven't already:
```javascript
paths: {
...
'moment': 'bower_components/moment/moment',
'disposer': 'bower_components/koco-disposer/src/disposer',
'daterangepicker': 'bower_components/koco-date-range-picker-binding-handler/modified_bower_components/bootstrap-daterangepicker/daterangepicker'
...
}
```
You'll also need to include in your `styles.less`:
```css
// Core variables and mixins
...
(inline) "../bower_components/bootstrap-daterangepicker/daterangepicker-bs3.css";
...
// Components
"../components/koco-date-range-picker-binding-handler/src/date-range-picker.less";
```
Finally, make sure you load the `daterangepicker` library, by convention in `jquery-plugins.js`
```javascript
define([
...
'daterangepicker',
...
```