billdami / ember-date-picker

A lightweight, mobile-optimized, date picker component for ember.js applications.
MIT License
28 stars 8 forks source link

ember-date-picker

A lightweight, mobile-optimized, date picker component for ember.js applications.

DISCLAIMER: This is beta software and has yet to be battle tested in a wide range of environments. As such, it should be used with caution in production apps. If you encounter any bugs or browser-specific anomalies, please submit an issue or a pull request. Thanks!

Demo

http://billdami.com/ember-date-picker/

Features

Installation

  1. bower install ember-date-picker or grab the files in dist/.
  2. Install ember-spin-box dependency (will already be downloaded if you used bower on step 1)
  3. Add dist/ember-date-picker.min.js to your application's javascript assets.
  4. Add dist/ember-date-picker.min.css to your application's css assets. Or if you use LESS, and intend to customize the component's styles, you can import lib/styles/ember-date-picker.less.
  5. Optional: Install moment.js to enable custom date format parsing/output.

Usage

ember-date-picker is comprised of several sub-components, namely {{date-picker-input}} and {{date-picker-controls}}, for optimal efficiency and compatibility with a wide range of application structures, especially when a view contains multiple date pickers (the inputs may share a a single instance of {{date-picker-controls}}). With this in mind, the minimum required syntax for rendering a date picker is as follows:

{{date-picker-input controls="my-datepicker" value=myDate}}
{{date-picker-controls id="my-datepicker"}}

The controls parameter of the {{date-picker-input}} must reference the id of an existing {{date-picker-controls}} component. Note that the id given to the {{date-picker-controls}} is also used as its HTML id attribute value, so make sure that it is unique!

{{date-picker-input}} Parameters

{{date-picker-controls}} Parameters