Datetimepicker add-on for ember-cli
npm install ember-bootstrap-datetimepickerDatetimepicker add-on for ember-cli
``bash`
ember install ember-bootstrap-datetimepicker
Generate blueprints
`bash`
ember generate ember-bootstrap-datetimepicker
Two-way bindings are replaced by data down, actions up (DDAU).
See: http://emberjs.com/blog/2015/06/12/ember-1-13-0-released.html#toc_ember-2-0-beta
Before:
`handlebars`
{{bs-datetimepicker date=mydate format='YYYY-MM-DD'}}
After:
`handlebars`
{{bs-datetimepicker date=mydate format='YYYY-MM-DD' updateDate=(action (mut model.date2))}}
handlebars
{{bs-datetimepicker date=mydate format='YYYY-MM-DD'}}
`$3
The twitter bootstrap resources will not be imported to your resources by default. If you want the add-on to add it you have to specify it in the ember-cli-build.js. (This options will be deprecated)`javascript
var app = new EmberApp(defaults, {
'ember-bootstrap-datetimepicker': {
"importBootstrapCSS": true,
"importBootstrapJS": true,
"importBootstrapTheme": true
}
});
`Building yourself ##
Check out the demo on github pages.
Alternatively you can clone this repo and run the app
`bash
sudo npm install -g ember-cli
git clone https://github.com/plusacht/ember-bootstrap-datetimepicker.git
cd ember-bootstrap-datetimepicker
npm install; bower install
ember serve
`
* Visit your app at http://localhost:4200.General Options ##
All options supported offered by bootstrap-datetimepicker are supportedBound Options ##
$3
Type: DateThis variable will be changed when the user changes the date and on the other side it will update the datetime picker when "date" is updated
$3
Type: DateWhen you change this variable the component trigger an update to the minDate on the jQuery plugin.
$3
Type: DateWhen you change this variable the component trigger an update to the maxDate on the jQuery plugin.
$3
Type: DateWhen you change this variable the component trigger an update to the disabledDates on the jQuery plugin.
$3
Type: Array DateWhen you change this variable the component trigger an update to the enabledDates on the jQuery plugin.
$3
Type: BooleanForces the parameter to
updateDate to be a native javascript Date instead of a moment.js Date.$3
Type: StringPlaceholder support when input field is blank
Usage ##
$3
Define your model`javascript
var App.DateExample = Ember.Object.create({
date1: moment(),
mindate: moment("2014-11-01"),
maxdate: moment("2015-12-01"),
disabled:true});
}
`Add the component to your template and bind the model.mindate with the component's minDate.
`handlebars
{{bs-datetimepicker date=date1 minDate=mindate maxDate=maxdate}}
`Change minDate so the jquery plugin will be updated with the minDate value
`javascript
App.DateExample.set('maxdate', moment("2015-03-01"));
``0.4.0 - 0.4.1
* 1.11.3
* 1.12.1
* 1.13.3
This add-on is based on bootstrap-datetimepicker
plus8 gmbh © 2014-2015