ember-cli-moment-range
v0.1.4
Published
Ember CLI wrapper for moment-range
Downloads
9
Maintainers
Readme
Ember CLI Moment Range
ES6 accessible module for both Moment.js and moment-range within your Ember.js application
Installation
Installing the Ember CLI Moment Range addon installs both moment and moment-range.
ember install ember-cli-moment-range
Usage
To use moment
in your Ember app, import the module
and call moment
as you would the global moment
.
To use moment-range, invoke the moment.range()
function.
Example
// app/components/date-range.js
import Component from 'ember-component';
import computed from 'ember-computed';
import moment from 'moment';
export default Component.extend({
dateRange: computed(function () {
let startDate = moment('2016-05-18', 'YYYY-MM-DD');
let endDate = moment('2016-12-31', 'YYYY-MM-DD');
return moment.range(startDate, endDate);
})
});
To learn more about moment
, see the Moment.js Guides
and the moment-range examples.
Contributing
Installing
git clone [email protected]:hankfanchiu/ember-cli-moment-range.git
cd ember-cli-moment-range
npm install
bower install
Running
ember server
- Visit your app at http://localhost:4200.
Testing
ember test
ember test --server
Building
ember build
For more information on using ember-cli, visit http://ember-cli.com.