/aurelia-bootstrap-datepicker

An aurelia port for bootstrap-datepicker

Primary LanguageJavaScriptCreative Commons Zero v1.0 UniversalCC0-1.0

aurelia-bootstrap-datepicker

This is an aurelia port of the bootstrap-datpicker found here

To keep up to date on Aurelia, please visit and subscribe to the official blog. If you have questions, we invite you to join us on Gitter. If you would like to have deeper insight into our development process, please install the ZenHub Chrome Extension and visit any of our repository's boards. You can get an overview of all Aurelia work by visiting the framework board.

Dependencies

This library has external dependencies:

  • jquery
  • bootstrap-datepicker

Used By

This library is a plugin and is not used by the core framework.

How to install this plugin?

  1. In your project install the plugin with following commands:
  • jspm

    jspm install npm:aurelia-bootstrap-datepicker
  • npm

    npm install aurelia-bootstrap-datepicker --save
  1. Make sure you use manual bootstrapping. In order to do so open your index.html and locate the element with the attribute aurelia-app. Change it to look like this:
  <body aurelia-app="main">
  ...
  1. Create (if you haven't already) a file main.js in your src folder with following content:
  export function configure(aurelia) {
    aurelia.use
      .standardConfiguration()
      .developmentLogging()
      .plugin('aurelia-bootstrap-datepicker');

    aurelia.start().then(a => a.setRoot());
  }

Using the plugin

Simply use the tag

  <bootstrap-datepicker value.bind="'mm-dd-yyyy'" dp-options.bind="dpOptions" changedate.delegate="mychangedatefunction($event)"></bootstrap-datepicker>

You can use the following properties:

  • value - string - a date string, default format is 'mm-dd-yyyy'. otherwise the format specified in your dp-options
  • dp-options - object - an object containing the options for the datepicker. All possibilities are found here.

Events

You can subscribe to the following events:

  • changedate - event - Fired when the date is changed.