0.1.4 • Published 10 years ago

ember-cli-moment-range v0.1.4

Weekly downloads
26
License
MIT
Repository
github
Last release
10 years ago

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.