Skip to content

istrau2/aurelia-flatpickr

 
 

Repository files navigation

aurelia-flatpickr

This is an aurelia flatpickr plugin. Use as a custom element.

Getting Started

Install from npm:

  npm install aurelia-flatpickr

In your application entry file:

  export async function configure(aurelia) {
    aurelia.use
        .plugin(PLATFORM.moduleName('aurelia-flatpickr'))
        ...
  }

Then use as a custom element anywhere throughout your application:

  <aurelia-flatpickr config.bind="config" value.bind="value"></aurelia-flatpickr>

Using Custom Input Groups

The default template for the input element can be replaced to customise the buttons available. Here's an example:

<aurelia-flatpickr config.bind="{wrap:true}">
  <div class="input-group aurelia-flatpickr">
      <input type="text" class="form-control" placeholder="Select date" data-input>
      <span class="input-group-btn">
          <button class="btn btn-default" type="button" data-clear>Clear</button>
          <button class="btn btn-default" type="button" data-toggle>Show</button>
      </span>
  </div>
</aurelia-flatpickr>

Running The Tests

To run the unit tests, first ensure that you have followed the steps above in order to install all dependencies and successfully build the library. Once you have done that, proceed with these additional steps:

  1. Ensure that the Karma CLI is installed. If you need to install it, use the following command:
npm install -g karma-cli
  1. Ensure that jspm is installed. If you need to install it, use the following commnand:
npm install -g jspm
  1. Install the client-side dependencies with jspm:
jspm install
  1. You can now run the tests with this command:
karma start

About

An aurelia flatpickr custom element

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 99.9%
  • HTML 0.1%