ember-cli-moment-range

0.1.4 • Public • Published

Ember CLI Moment Range

npm version Build Status Code Climate Ember Observer Score

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 git@github.com:hankfanchiu/ember-cli-moment-range.git
cd ember-cli-moment-range
npm install
bower install

Running

Testing

  • ember test
  • ember test --server

Building

  • ember build

For more information on using ember-cli, visit http://ember-cli.com.

Package Sidebar

Install

npm i ember-cli-moment-range

Weekly Downloads

9

Version

0.1.4

License

MIT

Last publish

Collaborators

  • hankfanchiu