openHPI/ember-bootstrap-datetimepicker

Name: ember-bootstrap-datetimepicker

Owner: HPI Knowledge Tech Group

Description: Ember CLI Bootstrap datetime picker

Forked from: plusacht/ember-bootstrap-datetimepicker

Created: 2016-09-13 21:43:29.0

Updated: 2016-09-13 21:43:30.0

Pushed: 2016-08-25 22:55:19.0

Homepage: null

Size: 1945

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Ember-bootstrap-datetimepicker Build Status

Datetimepicker add-on for ember-cli

Installation
r install ember-bootstrap-datetimepicker

Generate blueprints

r generate ember-bootstrap-datetimepicker
BREAKING CHANGE for Ember 2

There are some breaking-changes when using this addon > v0.4.1

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:

-datetimepicker date=mydate format='YYYY-MM-DD'}}

After:

-datetimepicker date=mydate format='YYYY-MM-DD' updateDate=(action (mut model.date2))}}
Basic Usage
Template
-datetimepicker date=mydate format='YYYY-MM-DD'}}
Brocfile.js

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)

app = new EmberApp(defaults, {
mber-bootstrap-datetimepicker': {
mportBootstrapCSS": true,
mportBootstrapJS": true,
mportBootstrapTheme": true


Building yourself

Check out the demo on github pages. Alternatively you can clone this repo and run the app

 npm install -g ember-cli
clone https://github.com/plusacht/ember-bootstrap-datetimepicker.git
mber-bootstrap-datetimepicker
install; bower install
r serve
General Options

All options supported offered by bootstrap-datetimepicker are supported

Bound Options
date

Type: Date

This 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

minDate

Type: Date

When you change this variable the component trigger an update to the minDate on the jQuery plugin.

maxDate

Type: Date

When you change this variable the component trigger an update to the maxDate on the jQuery plugin.

disabledDates

Type: Date

When you change this variable the component trigger an update to the disabledDates on the jQuery plugin.

enabledDates

Type: Array Date

When you change this variable the component trigger an update to the enabledDates on the jQuery plugin.

forceDateOutput

Type: Boolean

Forces the parameter to updateDate to be a native javascript Date instead of a moment.js Date.

placeholder

Type: String

Placeholder support when input field is blank

Usage
Min / Maxdate example

Define your model

App.DateExample = Ember.Object.create({
te1: moment(),
ndate: moment("2014-11-01"),
xdate: moment("2015-12-01"),
sabled:true});

Add the component to your template and bind the model.mindate with the component's minDate.

-datetimepicker date=date1 minDate=mindate maxDate=maxdate}}

Change minDate so the jquery plugin will be updated with the minDate value

DateExample.set('maxdate', moment("2015-03-01"));
Ember Compatibility

0.4.0 - 0.4.1

Credits

This add-on is based on bootstrap-datetimepicker

Legal

plus8 gmbh © 2014-2015

Licensed under the MIT license


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.