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!
http://billdami.com/ember-date-picker/
bower install ember-date-picker
or grab the files in dist/
.dist/ember-date-picker.min.js
to your application's javascript assets.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
.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-input}}
renders a regular text input element, any valid HTML attribute (e.g. value
, class
, placeholder
, ect) may be provided.string
, required)id
of the {{date-picker-controls}}
component that the input is associated with.string
)int|string|bool
, default: false
)false
, there is no minimum year. A string value may be provided to specify a year relative to the current date (e.g. "-10"
, or "+25"
).int|string|bool
, default: false
)false
, there is no maximum year. A string value may be provided to specify a year relative to the current date (e.g. "-10"
, or "+25"
).string
){{date-picker-controls}}
Parametersstring
, required){{date-picker-input}}
uses to associate with the component via its controls
parameter.i18n (object
)
Localized text strings for the controls UI. If provided, this parameter must match exactly the structure of the default i18n object below:
{
done: "Done",
clear: "Clear",
today: "Today",
monthNames: [
"January", "February", "March", "April", "May", "June",
"July", "August", "September", "October", "November", "December"
]
}
string
){{date-picker-controls}}
component. If an associated {{date-picker-input}}
specifies its own dateFormat
, it will override this setting while that input is active.int|string|bool
, default: false
){{date-picker-controls}}
component. If an associated {{date-picker-input}}
specifies its own minYear
, it will override this setting while that input is active.int|string|bool
, default: false
){{date-picker-controls}}
component. If an associated {{date-picker-input}}
specifies its own maxYear
, it will override this setting while that input is active.